forked from Snck3rs/contao-leaflet-maps
Pass service container to mapper factory.
This commit is contained in:
@@ -53,13 +53,14 @@ class BootSubscriber implements EventSubscriberInterface
|
|||||||
*/
|
*/
|
||||||
public function initializeDefinitionMapper(InitializeDefinitionMapperEvent $event)
|
public function initializeDefinitionMapper(InitializeDefinitionMapperEvent $event)
|
||||||
{
|
{
|
||||||
$mapper = $event->getDefinitionMapper();
|
$mapper = $event->getDefinitionMapper();
|
||||||
|
$container = $GLOBALS['container']['leaflet.service-container'];
|
||||||
|
|
||||||
foreach ($GLOBALS['LEAFLET_MAPPERS'] as $className) {
|
foreach ($GLOBALS['LEAFLET_MAPPERS'] as $className) {
|
||||||
if (is_array($className)) {
|
if (is_array($className)) {
|
||||||
$mapper->register(new $className[0], $className[1]);
|
$mapper->register(new $className[0], $className[1]);
|
||||||
} else {
|
} else {
|
||||||
$mapper->register(new $className());
|
$mapper->register(new $className($container));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user