1 | <?php |
||
22 | class Holiday extends DateTime |
||
23 | { |
||
24 | /** |
||
25 | * Holiday type - Holiday. |
||
26 | */ |
||
27 | const TYPE_HOLIDAY = 'holiday'; |
||
28 | |||
29 | /** |
||
30 | * Holiday type - School Holiday. |
||
31 | */ |
||
32 | const TYPE_SCHOOL_HOLIDAY = 'school'; |
||
33 | |||
34 | /** |
||
35 | * Holiday type - notable. |
||
36 | */ |
||
37 | const TYPE_NOTABLE = 'notable'; |
||
38 | |||
39 | /** |
||
40 | * Holiday type. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | private $type; |
||
45 | |||
46 | /** |
||
47 | * Holiday name. |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | private $name; |
||
52 | |||
53 | /** |
||
54 | * Creates a new Holiday. |
||
55 | * |
||
56 | * @param string $name Name |
||
57 | * @param mixed $time Time |
||
58 | * @param null|DateTimeZone $timezone (optional) Timezone |
||
59 | * @param null|string $type (optional) Type |
||
60 | */ |
||
61 | 47 | public function __construct( |
|
75 | |||
76 | /** |
||
77 | * Returns the holiday name. |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | 27 | public function getName() |
|
85 | |||
86 | /** |
||
87 | * Sets the holiday name. |
||
88 | * |
||
89 | * @param string $name |
||
90 | * |
||
91 | * @return Holiday |
||
92 | */ |
||
93 | 47 | public function setName($name) |
|
99 | |||
100 | /** |
||
101 | * Returns the holiday type. |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | 31 | public function getType() |
|
109 | |||
110 | /** |
||
111 | * Sets the holiday type. |
||
112 | * |
||
113 | * @param string $type |
||
114 | * |
||
115 | * @return Holiday |
||
116 | */ |
||
117 | 47 | public function setType($type) |
|
123 | } |
||
124 |