/** * execute * * @param mixed $date * @access public * @return void */ function execute($date) { $delta = $this->jobDelta - 1; $end_time = new Of_Date($date + $this->jobDelta); $this->logger->debug('Getting vacation to enable before '.$end_time->getIso()); $enable = $this->getVacationToInsert($end_time); $this->logger->debug('Getting vacation to disable before '.$end_time->getIso()); $date = new Of_Date($date); $disable = $this->getVacationToRemove($date); $intersec = array_intersect(array_keys($enable),array_keys($disable)); if(count($intersec) != 0) { $this->logger->warn(count($intersec).' vacation messages are set to be enabled AND disabled in the same job : '.implode(',',$intersec)); foreach($intersec as $id) { unset($enable[$id]); } } $this->enableVacation($enable); $this->disableVacation($disable); }