public function find($index)
    {
        $result = array();
        foreach ($this->events as $event) {
            if ($index instanceof PeriodInterface && $index->containsEvent($event)) {
                $result[] = $event;
            } elseif ($index instanceof \DateTime && $event->contains($index)) {
                $result[] = $event;
            }
        }

        return $result;
    }
public function find($index)
    {
        $result = array();
        foreach ($this->events as $event) {
            if ($index instanceof PeriodInterface && $index->containsEvent($event)) {
                $result[] = $event;
            } elseif ($index instanceof \DateTime && $event->contains($index)) {
                $result[] = $event;
            }
        }

        return $result;
    }
public function find ( $ index ) { $ result = array ( ) ; foreach ( $ this -> events as $ event ) { if ( $ index instanceof PeriodInterface && $ index -> containsEvent ( $ event ) ) { $ result [ ] = $ event ; } elseif ( $ index instanceof \ DateTime && $ event -> contains ( $ index ) ) { $ result [ ] = $ event ; } } return $ result ; }
Find events in the collection.

@param mixed $index

@return EventInterface[]
Find events in the collection .