/** * @ParamType("maxIterations", type="integer") * @ParamType("iterations", type="integer") * @ParamType("logger", type="@abc.logger") * * @param $maxIterations * @param int $iterations * @param LoggerInterface $logger */ public function schedule($maxIterations, $iterations = 0, LoggerInterface $logger) { $logger->info('schedule'); $iterations++; $this->job->setParameters(array($maxIterations, $iterations)); if ($iterations >= $maxIterations) { $this->job->removeSchedules(); $logger->info('removed schedule'); } }