/** * Registers a new job with a job object * @param CronJob $job * @return integer The id of the job * @throws zibo\ZiboException when the provided job id is already in use */ public function registerCronJob(CronJob $job) { $id = $job->getId(); if (array_key_exists($id, $this->jobs)) { throw new ZiboException('Could not register the job: the id of the job is already in use'); } $this->jobs[$id] = $job; return $id; }
/** * Decorates the provided cron job * @param zibo\cron\model\CronJob $job Cron job to decorate * @return string */ protected function decorateCronJob(CronJob $job) { $button = $this->form->getField(CronJobTable::BUTTON_INVOKE); return $button->getOptionHtml($job->getId()); }