/** * @param SchoolYear $schoolYear */ public function updateAllFrom(SchoolYear $schoolYear) { try { // load the file and add holidays $reader = new ICalendarFileReader($schoolYear->getIcalendarPath()); $events = $reader->loadEvents(); $this->removeAll($schoolYear); foreach ($events as $event) { $this->addEventWithin($event, $schoolYear); } $this->getEntityManager()->flush(); } catch (InvalidFileException $e) { } }
/** */ public static function setUpBeforeClass() { $cal = new ICalendarFileReader(self::$file_correct); self::$events = $cal->loadEvents(); }