| 1 | <?php |
||
| 17 | class Expiration |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var \DateTime |
||
| 21 | */ |
||
| 22 | private $storeTo; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var bool |
||
| 26 | */ |
||
| 27 | private $null; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Create new expiration with store message to time |
||
| 31 | * |
||
| 32 | * @param \DateTime $availableTo |
||
| 33 | * |
||
| 34 | * @return Expiration |
||
| 35 | */ |
||
| 36 | public static function storeTo(\DateTime $availableTo) : Expiration |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Create new expiration without store message |
||
| 47 | * |
||
| 48 | * @return Expiration |
||
| 49 | */ |
||
| 50 | public static function notStore() : Expiration |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Create expiration from null |
||
| 57 | * |
||
| 58 | * @return Expiration |
||
| 59 | */ |
||
| 60 | public static function fromNull() : Expiration |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Is null object? |
||
| 70 | * |
||
| 71 | * @return bool |
||
| 72 | */ |
||
| 73 | public function isNull() |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Get value |
||
| 80 | * |
||
| 81 | * @return int |
||
| 82 | * |
||
| 83 | * @throws \LogicException |
||
| 84 | */ |
||
| 85 | public function getValue() : int |
||
| 97 | |||
| 98 | /** |
||
| 99 | * Constructor. |
||
| 100 | */ |
||
| 101 | private function __construct() |
||
| 104 | } |
||
| 105 |