container = $container; } /** * Retrieve an iterator over all items * * @return ArrayIterator An iterator for the array of cron tasks */ public function getIterator() { $definitions = $this->container->findTaggedServiceIds('cron.task'); $tasks = array(); foreach ($definitions as $name => $definition) { $task = $this->container->get($name); if ($task instanceof phpbb_cron_task_base) { $task->set_name($name); } $tasks[] = $task; } return new ArrayIterator($tasks); } }