public function getRepositoryForEntity(string $entityName, string $connectionName = null): AbstractRepository
    {
        /** @var AbstractRepository $repository */
        $repository = $this->loadFactorableInstance($entityName);

        if (is_string($connectionName)) {
            $entityManager = $this->getContainer()->get('doctrine')->getManager($connectionName);
            $repository->setEntityManager($entityManager);
        }

        $this->onFactorableLoaded($repository);

        return $repository;
    }
public function getRepositoryForEntity(string $entityName, string $connectionName = null): AbstractRepository
    {
        /** @var AbstractRepository $repository */
        $repository = $this->loadFactorableInstance($entityName);

        if (is_string($connectionName)) {
            $entityManager = $this->getContainer()->get('doctrine')->getManager($connectionName);
            $repository->setEntityManager($entityManager);
        }

        $this->onFactorableLoaded($repository);

        return $repository;
    }
public function getRepositoryForEntity ( string $ entityName , string $ connectionName = null ) : AbstractRepository { /** @var AbstractRepository $repository */ $ repository = $ this -> loadFactorableInstance ( $ entityName ) ; if ( is_string ( $ connectionName ) ) { $ entityManager = $ this -> getContainer ( ) -> get ( 'doctrine' ) -> getManager ( $ connectionName ) ; $ repository -> setEntityManager ( $ entityManager ) ; } $ this -> onFactorableLoaded ( $ repository ) ; return $ repository ; }
Gets a repository for an entity

@param string $entityName
@param string $connectionName

@return AbstractRepository
Gets a repository for an entity