move bundle to root dir for inclusion in packagist refs #259

This commit is contained in:
2014-11-04 17:10:59 +01:00
parent b826d8e132
commit 8011746b26
100 changed files with 5243 additions and 823 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace Chill\CustomFieldsBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Reference;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class CustomFieldCompilerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('chill.custom_field_compiler')) {
throw new \LogicException('service chill.custom_field_compiler '
. 'is not defined.');
}
$definition = $container->getDefinition(
'chill.custom_field_compiler'
);
$taggedServices = $container->findTaggedServiceIds(
'chill.custom_field'
);
foreach ($taggedServices as $id => $tagAttributes) {
foreach ($tagAttributes as $attributes) {
$definition->addMethodCall(
'addCustomField',
array(new Reference($id), $attributes["type"])
);
}
}
}
}