Repository/Registry/RegistryFactory.php
public function getRegistry(string $registryName, $entityClass = null, EntityManager $entityManager = null)
    {
        if (!array_key_exists($registryName, self::$registries)) {
            throw new InvalidRegistryName($registryName);
        }

        $reflectionClass = new \ReflectionClass(self::$registries[$registryName]);

        /** @var RegistryInterface $instance */
        $instance = $reflectionClass->newInstance();

        $this->injectDependencies($instance, $entityClass, $entityManager);

        return $instance;
    }
public function getRegistry(string $registryName, $entityClass = null, EntityManager $entityManager = null)
    {
        if (!array_key_exists($registryName, self::$registries)) {
            throw new InvalidRegistryName($registryName);
        }

        $reflectionClass = new \ReflectionClass(self::$registries[$registryName]);

        /** @var RegistryInterface $instance */
        $instance = $reflectionClass->newInstance();

        $this->injectDependencies($instance, $entityClass, $entityManager);

        return $instance;
    }
public function getRegistry ( string $ registryName , $ entityClass = null , EntityManager $ entityManager = null ) { if ( ! array_key_exists ( $ registryName , self :: $ registries ) ) { throw new InvalidRegistryName ( $ registryName ) ; } $ reflectionClass = new \ ReflectionClass ( self :: $ registries [ $ registryName ] ) ; /** @var RegistryInterface $instance */ $ instance = $ reflectionClass -> newInstance ( ) ; $ this -> injectDependencies ( $ instance , $ entityClass , $ entityManager ) ; return $ instance ; }
Gets a registry from its name

@param string        $registryName
@param string        $entityClass
@param EntityManager $entityManager

@return RegistryInterface
Gets a registry from its name