コード例 #1
0
ファイル: Basic.php プロジェクト: morloderex/CalendR
 /**
  * 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]);
         }
     }
 }
コード例 #2
0
 /**
  * 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());
 }