1 | <?php |
||
12 | class DateField extends DataField |
||
13 | { |
||
14 | |||
15 | protected $cast = 'string'; |
||
16 | |||
17 | /** |
||
18 | * default formatting of ISO8601 |
||
19 | * |
||
20 | * @var string [Y-m-d\TH:i:sO] |
||
21 | */ |
||
22 | protected $format = Carbon::ISO8601; |
||
23 | |||
24 | /** |
||
25 | * TODO this needs to handle timezones better. |
||
26 | * we should check to make sure the wrong timezone isn't set or have some failsafes |
||
27 | * the return type should be definable and it's not yet |
||
28 | * |
||
29 | * (non-PHPdoc) |
||
30 | * |
||
31 | * @see \Solvire\API\Serializers\DataFields\DataField::setData() |
||
32 | * @param |
||
33 | * \DateTime |
||
34 | */ |
||
35 | 1 | public function setData($data) |
|
42 | |||
43 | /** |
||
44 | * This is a char so it will always be just a string |
||
45 | * |
||
46 | * @return Carbon or DateTime object |
||
47 | */ |
||
48 | 1 | public function getData() |
|
52 | } |