1 | <?php |
||
13 | class Recurrence |
||
14 | { |
||
15 | /** |
||
16 | * @var Frequency |
||
17 | */ |
||
18 | private $frequency; |
||
19 | |||
20 | /** |
||
21 | * @var \Datetime |
||
22 | */ |
||
23 | private $periodStartAt; |
||
24 | |||
25 | /** |
||
26 | * @var \Datetime |
||
27 | */ |
||
28 | private $periodEndAt; |
||
29 | |||
30 | /** |
||
31 | * @var integer |
||
32 | */ |
||
33 | private $interval = 1; |
||
34 | |||
35 | /** |
||
36 | * @var integer |
||
37 | */ |
||
38 | private $count; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | private $constraints = []; |
||
44 | |||
45 | /** |
||
46 | * Recurrence constructor. |
||
47 | */ |
||
48 | public function __construct() |
||
52 | |||
53 | /** |
||
54 | * @param \Datetime $periodStartAt |
||
55 | * @return $this |
||
56 | */ |
||
57 | public function setPeriodStartAt(\Datetime $periodStartAt) |
||
63 | |||
64 | /** |
||
65 | * @return \Datetime |
||
66 | */ |
||
67 | public function getPeriodStartAt() |
||
71 | |||
72 | /** |
||
73 | * @param \Datetime $periodEndAt |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function setPeriodEndAt(\Datetime $periodEndAt) |
||
82 | |||
83 | /** |
||
84 | * @return \Datetime |
||
85 | */ |
||
86 | public function getPeriodEndAt() |
||
90 | |||
91 | /** |
||
92 | * @return bool |
||
93 | */ |
||
94 | public function hasPeriodEndAt() |
||
98 | |||
99 | /** |
||
100 | * @param Frequency $frequency |
||
101 | * @return $this |
||
102 | */ |
||
103 | public function setFrequency(Frequency $frequency) |
||
109 | |||
110 | /** |
||
111 | * @return Frequency |
||
112 | */ |
||
113 | public function getFrequency() |
||
117 | |||
118 | /** |
||
119 | * @return int |
||
120 | */ |
||
121 | public function getInterval() |
||
125 | |||
126 | /** |
||
127 | * @param int $interval |
||
128 | * @return $this |
||
129 | */ |
||
130 | public function setInterval($interval) |
||
136 | |||
137 | /** |
||
138 | * @return int |
||
139 | */ |
||
140 | public function getCount() |
||
144 | |||
145 | /** |
||
146 | * @return bool |
||
147 | */ |
||
148 | public function hasCount() |
||
152 | |||
153 | /** |
||
154 | * @param int $count |
||
155 | * @return $this |
||
156 | */ |
||
157 | public function setCount($count) |
||
163 | |||
164 | /** |
||
165 | * @return array |
||
166 | */ |
||
167 | public function getConstraints() |
||
171 | |||
172 | /** |
||
173 | * @param array $constraints |
||
174 | * @return $this |
||
175 | */ |
||
176 | public function setConstraints(array $constraints) |
||
186 | |||
187 | /** |
||
188 | * @return bool |
||
189 | */ |
||
190 | public function hasConstraints() |
||
194 | |||
195 | /** |
||
196 | * @param RecurrenceConstraintInterface $constraint |
||
197 | * @return $this |
||
198 | */ |
||
199 | public function addConstraint(RecurrenceConstraintInterface $constraint) |
||
209 | |||
210 | /** |
||
211 | * @param string $constraintClassName |
||
212 | * @return $this |
||
213 | */ |
||
214 | public function removeConstraint($constraintClassName) |
||
228 | |||
229 | /** |
||
230 | * @param string $constraintClassName |
||
231 | * @return bool |
||
232 | */ |
||
233 | public function hasConstraint($constraintClassName) |
||
243 | |||
244 | /** |
||
245 | * @return bool |
||
246 | */ |
||
247 | public function hasProviderConstraint() |
||
257 | |||
258 | /** |
||
259 | * @return bool |
||
260 | */ |
||
261 | public function hasDatetimeConstraint() |
||
271 | } |
||
272 |