1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

[ticket/11152] Convert cron_task_collection to generic di_service_collection

PHPBB3-11152
This commit is contained in:
Igor Wiedler
2012-11-10 16:38:19 +01:00
parent 38e1c4ec5d
commit 798c006e7f
2 changed files with 8 additions and 8 deletions

View File

@@ -0,0 +1,49 @@
<?php
/**
*
* @package phpBB3
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Collection of services to be configured at container compile time.
*
* @package phpBB3
*/
class phpbb_di_service_collection extends ArrayObject
{
/**
* Constructor
*
* @param ContainerInterface $container Container object
*/
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
/**
* Add a service to the collection
*
* @param string $name The service name
* @return null
*/
public function add($name)
{
$task = $this->container->get($name);
$task->set_name($name);
$this->offsetSet($name, $task);
}
}