DependencyInjection/BridgeExtension.php
private function generateGroups(array $groups, $parentId, Definition $parent, ContainerBuilder $container)
    {
        foreach ($groups as $groupName => $group) {
            $groupId = $parentId.'.'.$groupName;

            $groupDefinition = $this->createComponentDefinition($groupName, $group['class'], $group['options']);
            $groupDefinition->addMethodCall('setService', array(new Reference($parentId)));

            $this->generateActions($group['actions'], $groupId, $groupDefinition, $container);

            $container->setDefinition($groupId, $groupDefinition);

            $parent->addMethodCall('addGroup', array(new Reference($groupId)));
        }
    }
private function generateGroups(array $groups, $parentId, Definition $parent, ContainerBuilder $container)
    {
        foreach ($groups as $groupName => $group) {
            $groupId = $parentId.'.'.$groupName;

            $groupDefinition = $this->createComponentDefinition($groupName, $group['class'], $group['options']);
            $groupDefinition->addMethodCall('setService', array(new Reference($parentId)));

            $this->generateActions($group['actions'], $groupId, $groupDefinition, $container);

            $container->setDefinition($groupId, $groupDefinition);

            $parent->addMethodCall('addGroup', array(new Reference($groupId)));
        }
    }
private function generateGroups ( array $ groups , $ parentId , Definition $ parent , ContainerBuilder $ container ) { foreach ( $ groups as $ groupName => $ group ) { $ groupId = $ parentId . '.' . $ groupName ; $ groupDefinition = $ this -> createComponentDefinition ( $ groupName , $ group [ 'class' ] , $ group [ 'options' ] ) ; $ groupDefinition -> addMethodCall ( 'setService' , array ( new Reference ( $ parentId ) ) ) ; $ this -> generateActions ( $ group [ 'actions' ] , $ groupId , $ groupDefinition , $ container ) ; $ container -> setDefinition ( $ groupId , $ groupDefinition ) ; $ parent -> addMethodCall ( 'addGroup' , array ( new Reference ( $ groupId ) ) ) ; } }
Generates services definitions for groups associated to a service.

@param array            $groups    Groups
@param string           $parentId  Parent component ID
@param Definition       $parent    Parent service definition
@param ContainerBuilder $container Container builder
Generates services definitions for groups associated to a service .