aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorMate Bartus <mate.bartus@gmail.com>2015-07-09 15:29:49 +0200
committerMate Bartus <mate.bartus@gmail.com>2015-07-09 15:30:30 +0200
commitb284e31a9e55e5fc617a229439282cc6d746432a (patch)
tree378cd5d6761b8bd9c3213e60e129bb3e5d26e468 /phpBB/phpbb
parent62103cec300ddadb904862ee2a74d68f71eb32ca (diff)
downloadforums-b284e31a9e55e5fc617a229439282cc6d746432a.tar
forums-b284e31a9e55e5fc617a229439282cc6d746432a.tar.gz
forums-b284e31a9e55e5fc617a229439282cc6d746432a.tar.bz2
forums-b284e31a9e55e5fc617a229439282cc6d746432a.tar.xz
forums-b284e31a9e55e5fc617a229439282cc6d746432a.zip
[ticket/13740] Add option to have class names in service collections
PHPBB3-13740
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/di/service_collection.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/phpBB/phpbb/di/service_collection.php b/phpBB/phpbb/di/service_collection.php
index 82ca9bf679..24f358ca84 100644
--- a/phpBB/phpbb/di/service_collection.php
+++ b/phpBB/phpbb/di/service_collection.php
@@ -26,6 +26,11 @@ class service_collection extends \ArrayObject
protected $container;
/**
+ * @var array
+ */
+ protected $service_classes;
+
+ /**
* Constructor
*
* @param ContainerInterface $container Container object
@@ -33,6 +38,7 @@ class service_collection extends \ArrayObject
public function __construct(ContainerInterface $container)
{
$this->container = $container;
+ $this->service_classes = array();
}
/**
@@ -76,4 +82,25 @@ class service_collection extends \ArrayObject
{
$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;
+ }
}