浏览代码

Merge pull request #735 from havvg/2.0

allow multiple filter type tags
Thomas 13 年之前
父节点
当前提交
869660f190
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      DependencyInjection/Compiler/AddFilterTypeCompilerPass.php

+ 4 - 4
DependencyInjection/Compiler/AddFilterTypeCompilerPass.php

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