Gets the EntityPersister for an Entity.

@param string $entityName  The name of the Entity.
@return \Doctrine\OXM\Persisters\RootXmlEntityPersister
191242
public function getXmlEntityPersister($entityName)
    {
        if ( ! isset($this->persisters[$entityName])) {
            $class = $this->xem->getClassMetadata($entityName);
            $this->persisters[$entityName] = new Persisters\RootXmlEntityPersister($this->xem, $class);
        }
        return $this->persisters[$entityName];
    }
463362
private function getObjectManager($entityClassname)
    {
        $objectManager = $this->getContainer()->get('doctrine')->getManagerForClass($entityClassname);
        if ($objectManager) {
            return $objectManager;
        }

        $objectManager = $this->getContainer()->get('doctrine_mongodb')->getManagerForClass($entityClassname);
        if ($objectManager) {
            return $objectManager;
        }

        throw new \RuntimeException(sprintf('Class "%s" is not a managed entity', $entityClassname));
    }
1299093
public function getRepository($entityName)
    {
        $entityName = ltrim($entityName, '\\');
        if (isset($this->repositories[$entityName])) {
            return $this->repositories[$entityName];
        }

        $metadata = $this->getClassMetadata($entityName);
        $customRepositoryClassName = $metadata->customRepositoryClassName;

        if ($customRepositoryClassName !== null) {
            $repository = new $customRepositoryClassName($this, $metadata);
        } else {
            $repository = new XmlEntityRepository($this, $metadata);
        }

        $this->repositories[$entityName] = $repository;

        return $repository;
    }
807411
public function getUserTypeEntity($entityId, $fieldName) {
        /** @noinspection PhpDynamicAsStaticMethodCallInspection */
        $item = \CUserTypeEntity::GetList(array(), array(
            'ENTITY_ID' => $entityId,
            'FIELD_NAME' => $fieldName
        ))->Fetch();

        return (!empty($item)) ? $this->getUserTypeEntityById($item['ID']) : false;
    }
679065
public function getDescriptor()
    {
        $entityDescriptor = EntityManager::getInstance()->get($this);
        return Manager::getInstance()->get($entityDescriptor);
    }
777049
public function getInstance($className)
    {
        switch ($className) {
            case '\\Zepi\\DataSource\\Doctrine\\Manager\\EntityManager':
                if ($this->entityManager === null) {
                    $configurationManager = $this->framework->getInstance('\\Zepi\\Core\\Utils\\Manager\\ConfigurationManager');
                    
                    $params = array(
                        'driver' => $configurationManager->getSetting('doctrine.databaseDriver'),
                        'host' => $configurationManager->getSetting('doctrine.databaseHost'),
                        'dbname' => $configurationManager->getSetting('doctrine.databaseName'),
                        'user' => $configurationManager->getSetting('doctrine.databaseUser'),
                        'password' => $configurationManager->getSetting('doctrine.databasePassword')
                    );
                    
                    $paths = array();
                    foreach ($this->framework->getModuleManager()->getModules() as $module) {
                        $paths[] = $module->getDirectory() . '/src/';
                    }
                    
                    $environment = strtoupper($configurationManager->getSetting('environment'));
                    $isDevMode = false;
                    if ($environment == 'DEV') {
                        $isDevMode = true;
                    }
                      
                    $config = \Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
                    
                    $path = $this->prepareCacheDirectory($environment);
                    $config->setProxyDir($path);
                    
                    if ($environment == 'DEV') {
                        $config->setAutoGenerateProxyClasses(AbstractProxyFactory::AUTOGENERATE_ALWAYS);
                    } else {
                        $config->setAutoGenerateProxyClasses(AbstractProxyFactory::AUTOGENERATE_NEVER);
                    }
                    
                    $doctrineEntityManager = \Doctrine\ORM\EntityManager::create($params, $config);
                    
                    $this->entityManager = new \Zepi\DataSource\Doctrine\Manager\EntityManager($doctrineEntityManager);
                }
                
                return $this->entityManager;
            break;
            
            default: 
                return $this->framework->initiateObject($className);
            break;
        }
    }
532319
public function getEntity($entityId)
    {
        if (isset($this->entities[$entityId])) {
            return $this->entities[$entityId];
        }

        $this->entities[$entityId] = $this->client->getEntity($entityId);

        return $this->entities[$entityId];
    }
166989
public function getRepository($entityName, $db = null)
    {
        return \erdiko\doctrine\EntityManager::getEntityManager()->getRepository($entityName);
    }
176967
protected function getResolver($eventName)
    {
        if ($this->isEntityEvent($eventName)) {
            return $this->entityEventResolver;
        }

        if (isset($this->resolverEventMap[$eventName]) && isset($this->customResolvers[$this->resolverEventMap[$eventName]])) {
            return $this->customResolvers[$this->resolverEventMap[$eventName]];
        }

        return $this->commonResolver;
    }
996590
private function getFieldDescriptors($entityName, $id)
    {
        if (null === $this->fieldDescriptors) {
            $this->initFieldDescriptors($entityName, $id);
        }

        return $this->fieldDescriptors;
    }
1150821
protected function getTableName($entityName)
    {
        $tableName = $entityName;
        preg_match_all('/[A-Z][a-z]+/', $entityName, $matches);
        if (!empty($matches[0])) {
            $tableName = implode('_', $matches[0]);
        }
        return strtolower($tableName);
    }
289416
public function getEntityStructure($entityClassName)
    {
        if ($entityClassName instanceof Entity) {
            $reflection = new \ReflectionClass($entityClassName);
            $entityClassName = $reflection->getName();
        }

        if (! $this->isRegistered($entityClassName)) {
            $this->registerEntity($entityClassName);
        }
        return $this->entities[$entityClassName];
    }
1268183
public function getPersisterForEntity(EntityInterface $entity)
    {
        return $this->isNewEntity($entity) ? $this->createPersister() : $this->createUpdateQuery();
    }
769879
public static function getEntityManager() {
		if (self::$_entityManager == null) {
			self::$_entityManager = self::_getInstance ();
		}
		return self::$_entityManager;
	}
946537
public function getPersister($key)
    {
        if (empty($key) || false === $this->hasPersister($key)) {
            throw PersisterException::persisterNotFound($key);
        }
        return $this->persisters[$key];
    }
763120
public function getRepository()
    {
        if ($this->repository === null) {
            $this->repository = $this->entityManager->getRepository($this->entityName);
        }

        return $this->repository;
    }
91875
public Entity getEntityByName(String entityName) {
        Entity entity = currentEntitiesByName.get(entityName.toUpperCase());
        Assert.notNull(entity, "You must be sure that an entity is present. Entity name=" + entityName);
        return entity;
    }