return an Entity name
@access protected
@param $entity string
@throws MissingEntityException
@return string
@since 3.0
@package Gcs\Framework\Core\Orm
163178
protected function _getEntityName($entity = '') {
        /** @var $class \Gcs\Framework\Core\Orm\Entity\Entity */

        $entity = ucfirst(preg_replace_callback("/(?:^|_)([a-z])/", function ($matches) {
            return strtoupper($matches[1]);
        }, $entity));

        $className = '\Orm\Entity\\' . ucfirst($entity);

        if (class_exists($className)) {
            return $entity;
        }
        else {
            throw new MissingEntityException('The Entity ' . $entity . ' does not exist');
        }
    }
1188245
protected function getEntityMapInstanceFor($entity)
    {
        // First, we'll try to load the entity map from cache, to
        // save from time consuming parsing of the relationships
        $entityMap = $this->getEntityMapInstanceFromCache($entity);

        if ($entityMap !== null) {
            return $entityMap;
        }

        if (class_exists($entity.'Map')) {
            $map = $entity.'Map';
            $map = new $map();

            return $map;
        }

        if ($map = $this->getMapFromNamespaces($entity)) {
            return $map;
        }

        if ($this->strictMode) {
            throw new EntityMapNotFoundException("No Map registered for $entity");
        }

        $map = $this->getNewEntityMap();

        return $map;
    }
259302
public function getEntityName(){
        $fullClass = $this->getEntityClass();
        $class = explode('\\', $fullClass);
        $entityName = lcfirst(array_pop($class));
        return $entityName;
    }
443846
private function recursivCompleteEntity($entity)
    {
        switch (true) {
            case is_a($entity, \RGU\Dvoconnector\Domain\Model\Meta\Association\Repertoire::class):

                return $this->metaRepository->findAssociationRepertoireByID($entity->getID());

                break;
            case is_a($entity, \RGU\Dvoconnector\Domain\Model\Meta\Association\Category::class):

                return $this->metaRepository->findAssociationCategoryByID($entity->getID());

                break;
            case is_a($entity, \RGU\Dvoconnector\Domain\Model\Meta\Association\Performancelevel::class):

                return $this->metaRepository->findAssociationPerformancelevelByID($entity->getID());

                break;
            case is_a($entity, \RGU\Dvoconnector\Domain\Model\Meta\Event\Type::class):

                return $this->metaRepository->findEventTypeByID($entity->getID());

                break;
            default:

                $classSchema = $this->reflectionService->getClassSchema(get_class($entity));

                foreach ($classSchema->getProperties() as $propertyName => $propertyDefinition) {
                    switch (true) {
                        case is_a($propertyDefinition['type'], \TYPO3\CMS\Extbase\Persistence\ObjectStorage::class, true):

                            $objectStorage = $entity->_getProperty($propertyName);
                            $newObjectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();

                            $objectStorage->rewind();

                            while ($objectStorage->valid()) {
                                $subEntity = $objectStorage->current();

                                if (!is_null($subEntity)) {
                                    $newSubEntity = $this->recursivCompleteEntity($subEntity);
                                    if ($newSubEntity) {
                                        $newObjectStorage->attach($newSubEntity);
                                    } else {
                                        $newObjectStorage->attach($subEntity);
                                    }
                                }

                                $objectStorage->next();
                            }

                            $entity->_setProperty($propertyName, $newObjectStorage);

                            break;
                        case is_a($propertyDefinition['type'], \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class, true):

                            $subEntity = $entity->_getProperty($propertyName);

                            if (!is_null($subEntity)) {
                                $newSubEntity = $this->recursivCompleteEntity($subEntity);
                                $entity->_setProperty($propertyName, $newSubEntity);
                            }

                            break;
                    }
                }

                return $entity;

                break;
        }
    }
311268
private function getUserInputEntity($entity)
    {
        // Get rid of any special chars introduced.
        $entity = $this->makeSQLUnsafe($entity);

        // Only replace first occurrence.
        return preg_replace('/' . $this->getParams()['DBPREFIX'] . '/', '', $entity, 1);
    }
701605
public static function getPrimaryKeyName($oEntity)
    {
        $aEntitieSetup = array();

        $oReflectionClass = new \ReflectionClass($oEntity);
        $oProperties   = $oReflectionClass->getProperties();

        foreach ($oProperties as $oProperty) {

            $sDoc = $oProperty->getDocComment();

            if (strstr($sDoc, '@ORM\Id') && preg_match('/@map ([a-zA-Z_]+)/', $sDoc, $aMatch)) {

                $aEntitieSetup[] = $aMatch[1];
            }
            else if (strstr($sDoc, '@ORM\Id')) {

                $aEntitieSetup[] = $oProperty->getName();
            }
        }

        if (count($aEntitieSetup) == 0) { return false; }
        else if (count($aEntitieSetup) == 1) { return $aEntitieSetup[0]; }
        else { return $aEntitieSetup; }
    }
759912
public static function getLinkedEntityName($entity) {
		if (elgg_instanceof($entity)) {
			return elgg_view('output/url', array(
				'text' => $entity->getDisplayName(),
				'href' => $entity->getURL(),
				'is_trusted' => true,
			));
		}
		return '';
	}
462378
protected function getEntityManager($entity)
    {
        if (!is_null($this->connection)) {
            return $this->registry->getManager($this->connection);
        }

        if (substr($entity, 0, 1) === '\\') {
            $entity = substr($entity, 1);
        }

        $em = $this->registry->getManagerForClass($entity);

        if ($em === null) {
            throw new InvalidArgumentException(sprintf("No Entity Manager could be found for [%s].", $entity));
        }

        return $em;
    }
799198
private function getOriginalEntityData($entity)
    {
        $class = $this->em->getClassMetadata(\get_class($entity));
        $data = $this->uow->getOriginalEntityData($entity);
        if ($class->isVersioned) {
            $versionField = $class->versionField;
            $data[$versionField] = $class->reflFields[$versionField]->getValue($entity);
        }

        return $data;
    }
1287836
public function getEntityName()
    {
        if (null == $this->entityName) {
            $this->setEntityName(get_class($this->getEntity()));
        }
        return $this->entityName;
    }
759901
private function getEntityEncryptionKey($entity)
    {
        $encryptedKey = $entity->getKey();

        if ($encryptedKey) {
            $key = $this->decryptSymmetricKey($entity);
        }
        else {
            $key = $this->generateSymmetricKey();

            // Insert the encrypted key in the entity
            $entity->setKey($this->encryptSymmetricKey($key, $entity));
        }

        return $key;
    }
104292
public function getMetaData($entity)
    {
        $propertyAnnotations = [];
        $result = new \stdClass;
        $class = new \ReflectionClass($entity);
        $classAnnotations = $this->_reader->getClassAnnotations($class);
        foreach ($class->getProperties() as $key => $value) {
            $annotation = $this->_reader->getPropertyAnnotations(new \ReflectionProperty($entity, $value->name));
            if (count($annotation)) {
                $propertyAnnotations[$value->name] = array_pop($annotation);
            }
        }

        foreach ($classAnnotations as $annotation) {
            if ($annotation instanceof \MercadoPago\Annotation\RestMethod) {
                $result->methods[$annotation->method] = get_object_vars($annotation);
            }
            if ($annotation instanceof \MercadoPago\Annotation\RequestParam) {
                $result->params[] = $annotation->param;
            }
            if ($annotation instanceof \MercadoPago\Annotation\DenyDynamicAttribute) {
                $result->denyDynamicAttribute = true;
            }
        }

        foreach ($propertyAnnotations as $key => $annotation) {
            if ($annotation instanceof \MercadoPago\Annotation\Attribute) {
                $result->attributes[$key] = get_object_vars($annotation);
            }
        }

        return $result;
    }
507221
private function getMeta($entity)
    {
        $parts  = explode('\\', $entity);
        $entity = array_pop($parts);

        if ($entity[0] == '@') {
            // Indirect entity definition; skip
            return null;
        }

        if (!isset($this->entityDefinitions[$entity])) {
            // Unknown entity definition; skip
            return null;
        }

        return $this->entityDefinitions[$entity];
    }
300300
private function getLoader($entity)
    {
        $entityClass = get_class($entity);

        if ($this->unsupportedClasses->containsKey($entityClass)) {
            return;
        }
        if ($this->loaders->containsKey($entityClass)) {
            return $this->loaders->get($entityClass);
        }
        foreach ($this->loaders as $handledClass => $loader) {
            if (is_a($entity, $handledClass)) {
                $this->loaders->set($entityClass, $loader);

                return $loader;
            }
        }

        $this->unsupportedClasses->set($entityClass, false);
    }
1146601
public function getRoutePrefix($entity)
    {
        $prefix = strtolower(str_replace(array('\\', '/'), '_', $entity));

        if ($prefix && '/' === $prefix[0]) {
            $prefix = substr($prefix, 1);
        }

        return str_replace('/', '_', $prefix);
    }
973503
public function getSingleIdentifierValue($entity)
    {
        $class     = $this->em->getClassMetadata(get_class($entity));
        $persister = $this->getEntityPersister($class->getClassName());

        if ($class->isIdentifierComposite()) {
            throw ORMInvalidArgumentException::invalidCompositeIdentifier();
        }

        $values = $this->isInIdentityMap($entity)
            ? $this->getEntityIdentifier($entity)
            : $persister->getIdentifier($entity);

        return $values[$class->identifier[0]] ?? null;
    }
1120881
private function getRelatedEntityIdentifier($entity)
    {
        \assert('is_object($entity)');

        if ($entity instanceof \Doctrine\Common\Persistence\Proxy) {
            $entity->__load();
        }

        $relClass = \get_class($entity);

        $ManagerForClass = $this->registry->getManagerForClass($relClass);

        if (!$ManagerForClass) {
            throw new \InvalidArgumentException(sprintf('The getManagerForClass for entity of class "%s" was empty.', $relClass));
        }

        $relId = $ManagerForClass->getMetadataFactory()
            ->getMetadataFor($relClass)->getIdentifierValues($entity);

        asort($relId);

        if (!$relId) {
            throw new \InvalidArgumentException(sprintf('The identifier for entity of class "%s" was empty.', $relClass));
        }

        return [$relClass, json_encode($relId)];
    }