1 | <?php |
||
10 | class Day |
||
11 | { |
||
12 | const MONDAY = 1; |
||
13 | const TUESDAY = 2; |
||
14 | const WEDNESDAY = 3; |
||
15 | const THURSDAY = 4; |
||
16 | const FRIDAY = 5; |
||
17 | const SATURDAY = 6; |
||
18 | const SUNDAY = 7; |
||
19 | |||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | private $number; |
||
24 | |||
25 | /** |
||
26 | * @var TimePeriod[] |
||
27 | */ |
||
28 | private $timePeriods = []; |
||
29 | |||
30 | 56 | public function __construct(int $number, array $timePeriods) |
|
35 | |||
36 | /** |
||
37 | * @return int |
||
38 | */ |
||
39 | 54 | public function getNumber(): int |
|
43 | |||
44 | /** |
||
45 | * @param int $number |
||
46 | * @return Day |
||
47 | */ |
||
48 | 56 | public function setNumber(int $number): Day |
|
54 | |||
55 | /** |
||
56 | * @return TimePeriod[] |
||
57 | */ |
||
58 | 26 | public function getTimePeriods() : array |
|
62 | |||
63 | /** |
||
64 | * @param TimePeriod[] $timePeriods |
||
65 | * @return Day |
||
66 | */ |
||
67 | 56 | public function setTimePeriods(array $timePeriods) : Day |
|
73 | |||
74 | /** |
||
75 | * @param TimePeriod $timePeriod |
||
76 | * |
||
77 | * @return Day |
||
78 | */ |
||
79 | 2 | public function addTimePeriod(TimePeriod $timePeriod) : Day |
|
85 | } |
||
86 |