src/Sulu/Bundle/PersistenceBundle/DependencyInjection/PersistenceExtensionTrait.php
private function getRepositoryDefinition($object, array $services, ContainerBuilder $container)
    {
        $repositoryKey = $this->getContainerKey('repository', $object, '.class');

        // default repository
        $repositoryClass = 'Sulu\Component\Persistence\Repository\ORM\EntityRepository';

        if ($container->hasParameter($repositoryKey)) {
            $repositoryClass = $container->getParameter($repositoryKey);
        }

        if (isset($services['repository'])) {
            $repositoryClass = $services['repository'];
        }

        $definition = new Definition($repositoryClass);
        $definition->setArguments([
            new Reference($this->getEntityManagerServiceKey()),
            $this->getClassMetadataDefinition($services['model']),
        ]);

        return $definition;
    }
private function getRepositoryDefinition($object, array $services, ContainerBuilder $container)
    {
        $repositoryKey = $this->getContainerKey('repository', $object, '.class');

        // default repository
        $repositoryClass = 'Sulu\Component\Persistence\Repository\ORM\EntityRepository';

        if ($container->hasParameter($repositoryKey)) {
            $repositoryClass = $container->getParameter($repositoryKey);
        }

        if (isset($services['repository'])) {
            $repositoryClass = $services['repository'];
        }

        $definition = new Definition($repositoryClass);
        $definition->setArguments([
            new Reference($this->getEntityManagerServiceKey()),
            $this->getClassMetadataDefinition($services['model']),
        ]);

        return $definition;
    }
private function getRepositoryDefinition ( $ object , array $ services , ContainerBuilder $ container ) { $ repositoryKey = $ this -> getContainerKey ( 'repository' , $ object , '.class' ) ; // default repository $ repositoryClass = 'Sulu\Component\Persistence\Repository\ORM\EntityRepository' ; if ( $ container -> hasParameter ( $ repositoryKey ) ) { $ repositoryClass = $ container -> getParameter ( $ repositoryKey ) ; } if ( isset ( $ services [ 'repository' ] ) ) { $ repositoryClass = $ services [ 'repository' ] ; } $ definition = new Definition ( $ repositoryClass ) ; $ definition -> setArguments ( [ new Reference ( $ this -> getEntityManagerServiceKey ( ) ) , $ this -> getClassMetadataDefinition ( $ services [ 'model' ] ) , ] ) ; return $ definition ; }
Get the repository service definition.

@param string $object
@param array $services
@param ContainerBuilder $container

@return Definition
Get the repository service definition .