Pass service container to mapper factory.

This commit is contained in:
David Molineus
2015-02-02 08:28:33 +01:00
parent 1546b0425d
commit 64b0aa5389

View File

@@ -53,13 +53,14 @@ class BootSubscriber implements EventSubscriberInterface
*/
public function initializeDefinitionMapper(InitializeDefinitionMapperEvent $event)
{
$mapper = $event->getDefinitionMapper();
$mapper = $event->getDefinitionMapper();
$container = $GLOBALS['container']['leaflet.service-container'];
foreach ($GLOBALS['LEAFLET_MAPPERS'] as $className) {
if (is_array($className)) {
$mapper->register(new $className[0], $className[1]);
} else {
$mapper->register(new $className());
$mapper->register(new $className($container));
}
}
}