| 1 |
<?php |
| 2 |
/** |
| 3 |
* Class PacketStatus |
| 4 |
* |
| 5 |
* @package Packetery |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace Packetery\Core\Entity; |
| 11 |
|
| 12 |
/** |
| 13 |
* Class PacketStatus |
| 14 |
* |
| 15 |
* @package Packetery |
| 16 |
*/ |
| 17 |
class PacketStatus { |
| 18 |
|
| 19 |
public const DELIVERED = 'delivered'; |
| 20 |
public const POSTED_BACK = 'posted back'; |
| 21 |
public const ARRIVED = 'arrived'; |
| 22 |
public const READY_FOR_PICKUP = 'ready for pickup'; |
| 23 |
public const DEPARTED = 'departed'; |
| 24 |
public const CANCELLED = 'cancelled'; |
| 25 |
public const RECEIVED_DATA = 'received data'; |
| 26 |
public const COLLECTED = 'collected'; |
| 27 |
public const PREPARED_FOR_DEPARTURE = 'prepared for departure'; |
| 28 |
public const HANDED_TO_CARRIER = 'handed to carrier'; |
| 29 |
public const RETURNED = 'returned'; |
| 30 |
public const UNKNOWN = 'unknown'; |
| 31 |
|
| 32 |
/** |
| 33 |
* Status name/code. |
| 34 |
* |
| 35 |
* @var string |
| 36 |
*/ |
| 37 |
private $name; |
| 38 |
|
| 39 |
/** |
| 40 |
* Translated name. |
| 41 |
* |
| 42 |
* @var string |
| 43 |
*/ |
| 44 |
private $translatedName; |
| 45 |
|
| 46 |
/** |
| 47 |
* Whether to synchronize packets with this state at default. |
| 48 |
* |
| 49 |
* @var bool |
| 50 |
*/ |
| 51 |
private $defaultSynchronization; |
| 52 |
|
| 53 |
/** |
| 54 |
* PacketStatus constructor. |
| 55 |
* |
| 56 |
* @param string $name Status name/code. |
| 57 |
* @param string $translatedName Translated name. |
| 58 |
* @param bool $defaultSynchronization Whether to synchronize packets with this state at default. |
| 59 |
*/ |
| 60 |
public function __construct( string $name, string $translatedName, bool $defaultSynchronization ) { |
| 61 |
$this->name = $name; |
| 62 |
$this->translatedName = $translatedName; |
| 63 |
$this->defaultSynchronization = $defaultSynchronization; |
| 64 |
} |
| 65 |
|
| 66 |
/** |
| 67 |
* Returns name. |
| 68 |
* |
| 69 |
* @return string |
| 70 |
*/ |
| 71 |
public function getName(): string { |
| 72 |
return $this->name; |
| 73 |
} |
| 74 |
|
| 75 |
/** |
| 76 |
* Returns translated name. |
| 77 |
* |
| 78 |
* @return string |
| 79 |
*/ |
| 80 |
public function getTranslatedName(): string { |
| 81 |
return $this->translatedName; |
| 82 |
} |
| 83 |
|
| 84 |
/** |
| 85 |
* Returns whether it has default synchronization. |
| 86 |
* |
| 87 |
* @return bool |
| 88 |
*/ |
| 89 |
public function hasDefaultSynchronization(): bool { |
| 90 |
return $this->defaultSynchronization; |
| 91 |
} |
| 92 |
|
| 93 |
} |
| 94 |
|