@param $persistentObjectName
@param null $persistentManagerName

@return \Doctrine\Common\Persistence\ObjectRepository
518987
protected function getRepository($persistentObjectName, $persistentManagerName = null)
    {
        return $this->container->get('doctrine')->getRepository($persistentObjectName, $persistentManagerName);
    }
850593
public function usePersistence(PersistenceDefinition $definition, StorageType $storageType = null)
    {
        $enabledPersistences = $this->settings->tryGet(KnownSettingsEnum::ENABLED_PERSISTENCES) ?: [];

        $enabledPersistences[] = new EnabledPersistence($definition, $storageType);

        $this->settings->set(KnownSettingsEnum::ENABLED_PERSISTENCES, $enabledPersistences);

        return $definition->createConfigurator($this->settings);
    }
1083694
public function getRepository($className)
    {
        $repositoryClass = $className . "Repository";

        if (class_exists($repositoryClass)) {
            return new $repositoryClass($className, $this);
        }

        return new Repository($className, $this);
    }
522231
public function getPropertyType() {
    if ($this->valueType === self::COLLECTION_VALUED) {
      return new PersistentCollectionType($this->gClass);
    } else {
      return new EntityType($this->gClass);
    }
  }
663826
public function getEntityPersister($entityName)
    {
        if (isset($this->entityPersisters[$entityName])) {
            return $this->entityPersisters[$entityName];
        }

        $class = $this->em->getClassMetadata($entityName);

        switch (true) {
            case $class->inheritanceType === InheritanceType::NONE:
                $persister = new BasicEntityPersister($this->em, $class);
                break;

            case $class->inheritanceType === InheritanceType::SINGLE_TABLE:
                $persister = new SingleTablePersister($this->em, $class);
                break;

            case $class->inheritanceType === InheritanceType::JOINED:
                $persister = new JoinedSubclassPersister($this->em, $class);
                break;

            default:
                throw new RuntimeException('No persister found for entity.');
        }

        if ($this->hasCache && $class->getCache()) {
            $persister = $this->em->getConfiguration()
                ->getSecondLevelCacheConfiguration()
                ->getCacheFactory()
                ->buildCachedEntityPersister($this->em, $persister, $class);
        }

        $this->entityPersisters[$entityName] = $persister;

        return $this->entityPersisters[$entityName];
    }
298438
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;
    }
843669
public function persistService($serviceName, $isPermanent = false)
    {
        $service = $this->grabService($serviceName);
        $this->persistentServices[$serviceName] = $service;
        if ($isPermanent) {
            $this->permanentServices[$serviceName] = $service;
        }
        if ($this->client) {
            $this->client->persistentServices[$serviceName] = $service;
        }
    }
1224572
public function getRepository($entityName)
    {
        $resolvedEntityName = $this->getEntityManager()->getEntityClassByInterface($entityName);
        $objectManager = $this->getObjectManagerAutoDetector()->getObjectManagerByClassName($resolvedEntityName);
        return $objectManager->getRepository($resolvedEntityName);
    }
630455
public function get($key, $persistent = false)
	{
		if ($persistent) {
			$origKey = $key;
			$key = "PVALUE.$key";
		}

		$key = strtoupper($key);

		if (isset($this->_config[$key]))
		{
			$value = $this->_config[$key];
			if ($value instanceof IProcessParameter)
			{
				return $value->getParameter();
			}
			else
			{
				return $value;
			}
		}
		elseif ($persistent)
		{
			if ($this->get($origKey) != "")
				$value = $this->get($origKey);
			else if ($this->getSession($key))
				$value = $this->getSession($key);
			else
				$value = "";

			$this->setSession($key, $value);
			$this->set($key, $value);

			return $value;
		}
		else
		{
			return "";
		}
	}
946537
public function getPersister($key)
    {
        if (empty($key) || false === $this->hasPersister($key)) {
            throw PersisterException::persisterNotFound($key);
        }
        return $this->persisters[$key];
    }
793182
public function loadCollection(PersistentCollectionInterface $collection)
    {
        $mapping = $collection->getMapping();
        switch ($mapping->association) {
            case PropertyMetadata::ASSOCIATION_TYPE_EMBED_MANY:
                $this->loadEmbedManyCollection($collection);
                break;

            case PropertyMetadata::ASSOCIATION_TYPE_REFERENCE_MANY:
                if ($mapping->repositoryMethod !== null) {
                    $this->loadReferenceManyWithRepositoryMethod($collection);
                } else {
                    if ($mapping->isOwningSide) {
                        $this->loadReferenceManyCollectionOwningSide($collection);
                    } else {
                        $this->loadReferenceManyCollectionInverseSide($collection);
                    }
                }
                break;
        }
    }
146196
public function rollback($unitName=""){

		if(empty($unitName))
			$unitName = PersistenceConfig::getDefaultUnit();
			
		$entityManager =  self::getEntityManager( $unitName );
		
		$entityManager->getConnection()->rollback();
	}
84820
public function createReferenceManyInverseSideQuery(PersistentCollection $collection)
    {
        $hints = $collection->getHints();
        $mapping = $collection->getMapping();
        $owner = $collection->getOwner();
        $ownerClass = $this->dm->getClassMetadata(get_class($owner));
        $targetClass = $this->dm->getClassMetadata($mapping['targetDocument']);
        $mappedByMapping = isset($targetClass->fieldMappings[$mapping['mappedBy']]) ? $targetClass->fieldMappings[$mapping['mappedBy']] : array();
        $mappedByFieldName = isset($mappedByMapping['simple']) && $mappedByMapping['simple'] ? $mapping['mappedBy'] : $mapping['mappedBy'] . '.$id';
        $criteria = $this->cm->merge(
            array($mappedByFieldName => $ownerClass->getIdentifierObject($owner)),
            $this->dm->getFilterCollection()->getFilterCriteria($targetClass),
            isset($mapping['criteria']) ? $mapping['criteria'] : array()
        );
        $criteria = $this->uow->getDocumentPersister($mapping['targetDocument'])->prepareQueryOrNewObj($criteria);
        $qb = $this->dm->createQueryBuilder($mapping['targetDocument'])
            ->setQueryArray($criteria);

        if (isset($mapping['sort'])) {
            $qb->sort($mapping['sort']);
        }
        if (isset($mapping['limit'])) {
            $qb->limit($mapping['limit']);
        }
        if (isset($mapping['skip'])) {
            $qb->skip($mapping['skip']);
        }
        if ( ! empty($hints[Query::HINT_SLAVE_OKAY])) {
            $qb->slaveOkay(true);
        }
        if ( ! empty($hints[Query::HINT_READ_PREFERENCE])) {
            $qb->setReadPreference($hints[Query::HINT_READ_PREFERENCE], $hints[Query::HINT_READ_PREFERENCE_TAGS]);
        }

        return $qb->getQuery();
    }
646477
public function find($entityName, $identifier, $lockMode = LockMode::NONE, $lockVersion = null)
    {
        return $this->getRepository($entityName)->find($identifier, $lockMode, $lockVersion);
    }
646251
protected function getRepository ($persistentObject = null) : EntityRepository
    {
        if (null === $persistentObject)
        {
            $persistentObject = $this->getFullEntityName();
        }

        return $this->doctrine->getRepository($persistentObject);
    }
245801
public function getRepository($entityName)
    {
        return new ListRepository($this->em, $this->em->getClassMetadata($entityName), $this);
    }
215956
public function setObjectName($objectName = null)
    {
        return parent::setObjectName(is_null($objectName) ? ( empty($this->getRecordIdent())
                    ? $this->getObjectName() : $this->getRecordIdent().'@'.$this->getObjectName() )
                    : $objectName);
    }