1 | <?php |
||
8 | class TimeCard implements \JsonSerializable |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | private $id; |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $title; |
||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | private $cycleTimes; |
||
22 | |||
23 | 5 | private function __construct(string $id, string $title) |
|
29 | |||
30 | 5 | public static function create( |
|
37 | |||
38 | /** |
||
39 | * @return string |
||
40 | */ |
||
41 | 4 | public function getId(): string |
|
45 | |||
46 | /** |
||
47 | * @return string |
||
48 | */ |
||
49 | 2 | public function getTitle(): string |
|
53 | |||
54 | /** |
||
55 | * @return array |
||
56 | */ |
||
57 | 2 | public function getCycleTimes(): array |
|
61 | |||
62 | /** |
||
63 | * @param string $fromKey |
||
64 | * @param string $toKey |
||
65 | * @return float|null |
||
66 | */ |
||
67 | 1 | public function getCycleTimesByFromAndTo(string $fromKey, string $toKey): ?float |
|
77 | |||
78 | 3 | public function setCycleTimesByFromAndTo(string $from, string $to, float $days) |
|
82 | |||
83 | 2 | public function calculateDayDifferenceBetweenColumns( |
|
95 | |||
96 | |||
97 | /** |
||
98 | * Specify data which should be serialized to JSON |
||
99 | * @link https://php.net/manual/en/jsonserializable.jsonserialize.php |
||
100 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
101 | * which is a value of any type other than a resource. |
||
102 | * @since 5.4.0 |
||
103 | */ |
||
104 | 2 | public function jsonSerialize() |
|
112 | } |