Pārlūkot izejas kodu

allow multiple filter type tags

Toni Uebernickel 13 gadi atpakaļ
vecāks
revīzija
74b85b8605

+ 4 - 4
DependencyInjection/Compiler/AddFilterTypeCompilerPass.php

@@ -32,13 +32,13 @@ class AddFilterTypeCompilerPass implements CompilerPassInterface
         $types      = array();
 
         foreach ($container->findTaggedServiceIds('sonata.admin.filter.type') as $id => $attributes) {
-            $name = $attributes[0]['alias'];
-
             $container->getDefinition($id)->setScope(ContainerInterface::SCOPE_PROTOTYPE);
 
-            $types[$name] = $id;
+            foreach ($attributes as $eachTag) {
+                $types[$eachTag['alias']] = $id;
+            }
         }
 
         $definition->replaceArgument(1, $types);
     }
-}
+}