class-cart-info.php in seQura 4.0.0, at src/Dto/class-cart-info.php
| 1 | <?php |
| 2 | /** |
| 3 | * Cart Info DTO |
| 4 | * |
| 5 | * @package SeQura/WC |
| 6 | */ |
| 7 | |
| 8 | namespace SeQura\WC\Dto; |
| 9 | |
| 10 | /** |
| 11 | * Cart Info DTO. |
| 12 | */ |
| 13 | class Cart_Info extends Dto { |
| 14 | |
| 15 | /** |
| 16 | * Unique identifier |
| 17 | * |
| 18 | * @var string |
| 19 | */ |
| 20 | public $ref; |
| 21 | |
| 22 | /** |
| 23 | * ISO 8601 date of creation |
| 24 | * |
| 25 | * @var string |
| 26 | */ |
| 27 | public $created_at; |
| 28 | |
| 29 | /** |
| 30 | * Constructor |
| 31 | */ |
| 32 | public function __construct( ?string $ref = null, ?string $created_at = null ) { |
| 33 | $this->ref = $ref ? $ref : uniqid(); |
| 34 | $this->created_at = $created_at ? $created_at : gmdate( 'c' ); |
| 35 | } |
| 36 | } |
| 37 |