15 private ?
Date $start =
null;
20 private bool $single =
false;
28 $this->start = $start;
38 public function getSpecificTimeCollection(
string $dateFormat =
null): array
42 throw new PropertyException(
'You should set start event time. Use setEventStart.');
45 return array_map(
function ($remind) use ($dateFormat) {
50 ->setEventStart($this->start)
55 catch (PropertyException $exception)
65 public function getFilterRemindBeforeEventStart(): array
67 return array_filter($this->collection,
function ($remind) {
72 ->setEventStart($this->start)
73 ->isBeforeEventStart()
76 catch (PropertyException $exception)
88 public function deDuplicate(): self
92 throw new PropertyException(
'You should set start event time. Use setEventStart.');
98 foreach ($this->collection as $remind)
101 ->setEventStart($this->start)
105 if (empty($remindList[$key]))
107 $remindList[$key] = $remind;
111 $remindList[$key] = $this->chooseRemindByRank($remind, $remindList[$key]);
115 $this->collection = array_values($remindList);
125 usort($this->collection,
function (
Remind $remind1,
Remind $remind2) {
131 $remind1->setEventStart($this->start);
132 $remind2->setEventStart($this->start);
172 return $this->single;
182 $this->single = $single;