eZ\Publish\Core\Base\Container\Compiler\RegisterLimitationTypePass::process PHP Method

process() public method

public process ( ContainerBuilder $container )
$container Symfony\Component\DependencyInjection\ContainerBuilder
    public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('ezpublish.api.repository.factory')) {
            return;
        }
        $repositoryFactoryDef = $container->getDefinition('ezpublish.api.repository.factory');
        // Limitation types.
        // Alias attribute is the limitation type name.
        foreach ($container->findTaggedServiceIds('ezpublish.limitationType') as $id => $attributes) {
            foreach ($attributes as $attribute) {
                if (!isset($attribute['alias'])) {
                    throw new \LogicException('ezpublish.limitationType service tag needs an "alias" attribute to identify the limitation type. None given.');
                }
                $repositoryFactoryDef->addMethodCall('registerLimitationType', array($attribute['alias'], new Reference($id)));
            }
        }
    }
RegisterLimitationTypePass