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