Get entity params by name

@param  string $entityName
@param  bool $isOrmEntityDefs
@param  mixed $returns
@return mixed
777911
protected function getEntityParams($entityName = null, $isOrmEntityDefs = false, $returns = null)
    {
        if (!isset($entityName)) {
            $entityName = $this->getEntityName();
        }

        $entityDefs = $this->getDefs($isOrmEntityDefs);

        if (isset($entityDefs[$entityName])) {
            return $entityDefs[$entityName];
        }

        return $returns;
    }
640524
private function getSourcePropertyValues(array $sourcePropertyPaths, $entity, $entityClass)
    {
        $sourcePropertyValues = [];

        foreach ($sourcePropertyPaths as $sourcePropertyPath) {
            if (!$this->propertyAccessor->isReadable($entity, $sourcePropertyPath)) {
                throw $this->createPropertyNotReadableException($entityClass, $sourcePropertyPath);
            }

            $sourcePropertyValues[$sourcePropertyPath] = $this->propertyAccessor->getValue($entity, $sourcePropertyPath);
        }

        return $sourcePropertyValues;
    }
908900
public function getMappedFirstEntitiesByEntityType($entityName)
    {
        $entities = [];
        foreach ($this->data as $data) {
            $entity = $this->createAndReturnNewFirstEntity($data, $entityName);
            if ($entity) {
                $entities[] = $entity;
            }
        }
        return $entities;
    }
586575
public function getMetadataFor($entityName, array $parentName = array())
    {
        return $this->hydrateDataObject(
            $this->entityManager->getMetadataFactory()->getMetadataFor($entityName),
            $parentName
        );
    }
346212
public function getEntityPersister($entityName)
    {
        if (isset($this->persisters[$entityName])) {
            return $this->persisters[$entityName];
        }

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

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

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

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

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

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

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

        return $this->persisters[$entityName];
    }
525511
protected function getValues($valueClass, array $entitiesById)
    {
        /** @var EntityRepository $valueRepository */
        $valueRepository = $this->entityManager->getRepository($valueClass);
        $qb = $valueRepository->createQueryBuilder('e');
        $qb
            ->addSelect('d', 'dv')
            ->join('e.data', 'd')
            ->leftJoin('e.dataValue', 'dv')
            ->where('e.data IN (:data)')
            ->setParameter('data', $entitiesById);

        return $qb->getQuery()->getResult();
    }
506482
public function getSearchableEntityMeta($entityName)
    {
        $allMeta = $this->getSearchableEntitiesMeta();

        if (!isset($allMeta[$entityName])) {
            throw new SearchException(sprintf('Entity "%s" is not searchable.', $entityName));
        }

        return $allMeta[$entityName];
    }
499907
private function castToEntity($matches)
    {
        $entities = $this->entityRegistry->getEntityBuilder()->castToEntity($matches, $this->entityClass);

        return $entities;
    }
882312
public function getNodeByEntityName($entityName)
    {
        if (false !== ($index = array_search($entityName, $this->nodesEntities))) {
            if ($this->offsetExists($index)) {
                return $this->offsetGet($index);
            }
        }

        return false;
    }
603364
private function getEntityIdentifierAspectValue( $source, $evaluationResult, $log )
	{

		// Get the entity identifier from the source
		if ( is_null( $this->entityIdentifierRule ) )
		{
			$context = $this->getContextForSource( $source, $evaluationResult, ASPECT_ENTITY_IDENTIFIER, $log, $contextRef );
			if ( ! $context || is_null( $context['entity']['identifier'] ) ) return null;

			// TODO What is in the $context array
			return $context['entity']['identifier'];
		}
		else
		{
			/**
			 * @var EntityIdentifier $identifier
			 */
			$identifier = EntityIdentifier::fromArray( $this->entityIdentifierRule );
			// This function will throw an exception if there is a problem so there is no return value to check
			$this->checkSAVConflicts( $identifier->source, ASPECT_ENTITY_IDENTIFIER, $evaluationResult, $log );
			return $identifier->getValue( $this, $evaluationResult, $log );
		}

	}
646477
public function find($entityName, $identifier, $lockMode = LockMode::NONE, $lockVersion = null)
    {
        return $this->getRepository($entityName)->find($identifier, $lockMode, $lockVersion);
    }
461539
public function documentToEntity($document, string $entityClassName)
    {
        if (!$this->annotationParser->isEntityClass($entityClassName)) {
            return $document;
        }

        try {
            $reflectClass = new \ReflectionClass($entityClassName);
        } catch (\Exception $exception) {
            return $document;
        }

        $entity = new $entityClassName();

        foreach ($reflectClass->getProperties() as $documentProperty) {
            if ($documentProperty->isStatic()) {
                continue;
            }

            $annotation = $this->annotationParser->getPropertyAnnotation($documentProperty);
            if (null === $annotation) {
                continue;
            }

            $propertyName = $annotation->name ?? $documentProperty->getName();
            if ($annotation->id) {
                $propertyName = '_id';
            }
            $propertyValue = $document->{$propertyName} ?? null;
            $fieldValue = $this->propertyToField($propertyValue, $annotation);

            $documentProperty->setAccessible(true);
            $documentProperty->setValue($entity, $fieldValue);
        }

        return $entity;
    }
1328591
public function buildListEntityInterfaces(array $entityClassNames = [])
    {
        $listEntityInterfaces = [];

        $moduleOptionsManager = $this->getModuleOptionsPluginManager();
        $allowedModules = $this->getAllowedModules($entityClassNames);

        foreach ($entityClassNames as $entityClassName) {
            $r = new ReflectionClass($entityClassName);
            $useInterfaces = $r->getInterfaceNames();
            foreach ($useInterfaces as $currentInterface) {
                if ($moduleOptionsManager->hasModuleNameByClassName($currentInterface)) {
                    $moduleNameByInterface = $moduleOptionsManager->getModuleNameByClassName($currentInterface);
                    if (array_key_exists($moduleNameByInterface, $allowedModules)) {
                        $listEntityInterfaces[$currentInterface] = $currentInterface;
                    }
                }
            }
        }

        return $listEntityInterfaces;
    }
166444
public function entityByResult(string $entity): array
    {
        $result = array_get($this->response, "data.result", '');

        return array_get($this->response, "data.entities.$entity.$result", []);
    }
208058
protected function getFakerObject(string $entityName, string $colName, array $colProps)
    {
        if (!isset($this->fakers[$entityName][$colName])) {
            $fakerClone = clone $this->faker;
            $this->fakers[$entityName][$colName] = isset($colProps['unique']) && $colProps['unique'] === true ? $fakerClone->unique() : $fakerClone;
        }

        return $this->fakers[$entityName][$colName];
    }
767816
public function joinTableName($sourceEntity, $targetEntity, $propertyName = null)
    {
        $names = [
            $this->classToFieldName($sourceEntity),
            $this->classToFieldName($targetEntity)
        ];

        sort($names);

        return implode('_', $names);
    }
418026
protected function getListBuilder($entityName, $fieldDescriptors)
    {
        /** @var RestHelperInterface $restHelper */
        $restHelper = $this->get('sulu_core.doctrine_rest_helper');

        /** @var DoctrineListBuilderFactory $factory */
        $factory = $this->get('sulu_core.doctrine_list_builder_factory');

        $listBuilder = $factory->create($entityName);

        $restHelper->initializeListBuilder(
            $listBuilder,
            $fieldDescriptors
        );

        return $listBuilder;
    }