/** * @param Event $event * @throws EventFrequencyEmptyException */ private function initNextRun(Event $event) { if (!$event->getFrequency()) { throw new EventFrequencyEmptyException(); } date_default_timezone_set($this->container->getParameter("app_core_timezone")); $cron = CronExpression::factory($event->getFrequency()); $cron->isDue(); $event->setNextRun($cron->getNextRunDate()); }