src/CSDT/CollectionsBundle/CollectionHelper/Compiler/ManagerCompiler.php
public function process(ContainerBuilder $container)
    {
        $manager = 'collection.helper.manager';
        $caster = 'collection.helper.caster';
        $method = 'addCaster';

        $taggedManager = $container->findTaggedServiceIds($manager);
        foreach ($taggedManager as $managerId => $tags) {
            $managerDefinition = $container->findDefinition($managerId);

            $taggedServices = $container->findTaggedServiceIds($caster);
            
            foreach ($taggedServices as $id => $tags) {
                $managerDefinition->addMethodCall(
                    $method,
                    array(new Reference($id))
                );
            }
        }
    }
public function process(ContainerBuilder $container)
    {
        $manager = 'collection.helper.manager';
        $caster = 'collection.helper.caster';
        $method = 'addCaster';

        $taggedManager = $container->findTaggedServiceIds($manager);
        foreach ($taggedManager as $managerId => $tags) {
            $managerDefinition = $container->findDefinition($managerId);

            $taggedServices = $container->findTaggedServiceIds($caster);
            
            foreach ($taggedServices as $id => $tags) {
                $managerDefinition->addMethodCall(
                    $method,
                    array(new Reference($id))
                );
            }
        }
    }
Process

This method process the container
to inject the casters into the
caster manager.

@param ContainerBuilder $container The application container builder

@return void