/** * Flush the events of one calendar * * @param \KevinDitscheid\KdCalendar\Domain\Model\Calendar $calendar */ public function flushEventsAction(\KevinDitscheid\KdCalendar\Domain\Model\Calendar $calendar) { $this->eventRepository->setCalendar($calendar); $events = $this->eventRepository->findByCalendar($calendar); foreach ($events as $event) { $this->eventRepository->remove($event); } $this->forward('authenticate', NULL, NULL, array('eventsFlushed' => TRUE)); }