1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 22:40:39 +02:00

[ticket/13740] Add option to have class names in service collections

PHPBB3-13740
This commit is contained in:
Mate Bartus
2015-07-09 15:29:49 +02:00
parent 62103cec30
commit b284e31a9e

View File

@@ -25,6 +25,11 @@ class service_collection extends \ArrayObject
*/ */
protected $container; protected $container;
/**
* @var array
*/
protected $service_classes;
/** /**
* Constructor * Constructor
* *
@@ -33,6 +38,7 @@ class service_collection extends \ArrayObject
public function __construct(ContainerInterface $container) public function __construct(ContainerInterface $container)
{ {
$this->container = $container; $this->container = $container;
$this->service_classes = array();
} }
/** /**
@@ -76,4 +82,25 @@ class service_collection extends \ArrayObject
{ {
$this->offsetSet($name, null); $this->offsetSet($name, null);
} }
/**
* Add a service's class to the collection
*
* @param string $service_id
* @param string $class
*/
public function add_service_classes($service_id, $class)
{
$this->service_classes[$service_id] = $class;
}
/**
* Get services' classes
*
* @return array
*/
public function get_service_classes()
{
return $this->service_classes;
}
} }