1 | <?php |
||
12 | abstract class AbstractRule implements RRuleInterface |
||
13 | { |
||
14 | /** @var DateTimeInterface|string */ |
||
15 | protected $startDate; |
||
16 | |||
17 | /** @var string */ |
||
18 | protected $rRule; |
||
19 | |||
20 | /** |
||
21 | * Rule constructor. |
||
22 | * @param string $rRule |
||
23 | * @param string|DateTimeInterface $startDate |
||
24 | */ |
||
25 | 25 | public function __construct($rRule, DateTimeInterface $startDate) |
|
26 | { |
||
27 | 25 | $this->rRule = $rRule; |
|
28 | 25 | $this->startDate = $startDate; |
|
29 | 25 | } |
|
30 | |||
31 | /** |
||
32 | * @return DateTimeInterface |
||
33 | */ |
||
34 | 24 | public function getStartDate() |
|
35 | { |
||
36 | 24 | return $this->startDate; |
|
37 | } |
||
38 | |||
39 | /** |
||
40 | * @return string recurrence rule string |
||
41 | */ |
||
42 | 24 | public function getRrule() |
|
43 | { |
||
44 | 24 | return $this->rRule; |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * @param DateTimeInterface $from |
||
49 | * @param DateTimeInterface $to |
||
50 | * @param boolean $inc |
||
51 | * @return DateTimeInterface[] |
||
52 | */ |
||
53 | abstract public function getRecurrences(DateTimeInterface $from, DateTimeInterface $to, $inc = true); |
||
54 | } |