Beispiel #1
0
 /**
  * Removes an event from the collection.
  *
  * @param EventInterface $event
  */
 public function remove(EventInterface $event)
 {
     foreach ($this->events as $key => $internalEvent) {
         if ($event->getUid() === $internalEvent->getUid()) {
             unset($this->events[$key]);
         }
     }
 }
 /**
  * Returns if $event is during this period.
  * Non strict. Must return true if :
  *  * Event is during period
  *  * Period is during event
  *  * Event begin is during Period
  *  * Event end is during Period
  *
  * @param EventInterface $event
  *
  * @return boolean
  */
 public function containsEvent(EventInterface $event)
 {
     return $event->containsPeriod($this) || $event->isDuring($this) || $this->contains($event->getBegin()) || $this->contains($event->getEnd());
 }