@param string $entityClass Entity class

@return string
765742
private function getTranslationPrefix($entityClass)
    {
        if ($this->metadataManager->hasMetadata($entityClass)) {
            return $this->metadataManager->getMetadata($entityClass)->getEntityTranslationPrefix();
        }

        $entityName = $this->objectNamer->name($entityClass);

        return preg_match('/_translation$/', $entityName)
            ? preg_replace('/_translation$/', '.entity.', $entityName)
            : 'log.object.'.$this->objectNamer->name($entityClass).'.property.';
    }
1298058
public function getEntityClassName($entity)
    {
        if (array_key_exists($entity, $this->entityMap)) {
            return $this->entityMap;
        }

        return $this->rootEntityNamespace . $entity;
    }
1265015
public function isEntityClass($class)
    {
        try {
            $refClass = new \ReflectionClass($class);
            $classAnnotation = $this->annotationReader->getClassAnnotation($refClass, Entity::class);
            if ($classAnnotation instanceof Entity) {
                return true;
            }
        } catch (\Exception $exception) {
            return false;
        }

        return false;
    }
788281
private function dumpLiteralClass(string $class): string
    {
        if (false !== strpos($class, '$')) {
            return sprintf('${($_ = %s) && false ?: "_"}', $class);
        }
        if (0 !== strpos($class, "'") || !preg_match('/^\'(?:\\\{2})?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?:\\\{2}[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*\'$/', $class)) {
            throw new RuntimeException(sprintf('Cannot dump definition because of invalid class name (%s)', $class ?: 'n/a'));
        }

        $class = substr(str_replace('\\\\', '\\', $class), 1, -1);

        return 0 === strpos($class, '\\') ? $class : '\\'.$class;
    }
84458
public function getChildOfClass($class)
    {
        // Check for namespace alias
        if (strpos($class, ':') !== false) {
            list($namespaceAlias, $simpleClassName) = explode(':', $class);
            $class = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
        }
        foreach ($this->getChildren() as $child) {
            if ($child->getPage() instanceof $class) {
                return $child;
            }
        }

        return null;
    }
790783
public function getRepositoryFor($entityClass)
    {
        if (!is_subclass_of($entityClass, EntityInterface::class)) {
            throw new InvalidArgumentException(
                'Cannot create ORM repository for a class that does not '.
                'implement EntityInterface.'
            );
        }

        return $this->repositories->containsKey($entityClass)
            ? $this->repositories->get($entityClass)
            : $this->createRepository($entityClass);
    }
928597
public static function getCodeGenerators($entityClass = null)
    {
        if ($entityClass) {
            if (!isset(self::$generators[$entityClass])) {
                throw new \Exception("There is no registered entity code generator for class $entityClass");
            }

            return self::$generators[$entityClass];
        } else {
            return self::$generators;
        }
    }
702602
private function getEntityAnnotation(\ReflectionClass $class)
    {
        if (!$this->annotationReader) {
            $this->annotationReader = new AnnotationReader();
        }

        return $this->annotationReader->getClassAnnotation($class, new Entity());
    }
1275518
private function getSlugsMetadata($entityClass)
    {
        if (!isset($this->slugsMetadata[$entityClass])) {
            $meta = $this->extendedMetadataFactory->getExtendedMetadata($entityClass);

            if (!isset($meta['slugs']) || empty($meta['slugs'])) {
                $message = sprintf(
                    'At least one property of class "%s" must be annotated with "%s" annotation in order to generate slug.',
                    $entityClass,
                    Slug::class
                );

                throw new SluggableException($message);
            }

            $this->slugsMetadata[$entityClass] = $meta['slugs'];
        }

        return $this->slugsMetadata[$entityClass];
    }
28416
public function getEntityListColumnType($columnTypeClass)
    {
        if (isset($this->columnTypes[$columnTypeClass])) {
            return $this->columnTypes[$columnTypeClass];
        }
        elseif (class_exists($columnTypeClass)) {
            return new $columnTypeClass();
        }
    }
760555
public function detect($entityClass)
    {
        $meta = $this->metadataManager->getMetadata($entityClass);
        $config = $meta->getConfiguration();

        if (!empty($config['order_by'])) {
            return $config['order_by'];
        }

        $criteria = [];

        $treeConfig = $this->treeListener->getConfiguration($this->em, $entityClass);

        if (!empty($treeConfig)) {
            $criteria[$treeConfig['level']] = 'asc';
        }

        $sortableConfig = $this->sortableListener->getConfiguration($this->em, $entityClass);

        if (!empty($sortableConfig)) {
            $criteria[$sortableConfig['position']] = 'asc';
        }
        if (!empty($criteria)) {
            return $criteria;
        }

        return [
            $meta->getIdentifier() => 'desc',
        ];
    }
970843
protected function formatAttributes($entityClass, array $attributes, $format = Attribute::FORMAT_PUT)
    {
        $entityClass = $this->getEntityClass($entityClass);
        $formatted = array();

        $mappings = $entityClass::getDataTypeMappings();
        foreach ($attributes as $attribute => $value) {
            if (isset($mappings[$attribute])) {
                $dataType = $mappings[$attribute];
                if (Attribute::FORMAT_PUT == $format) {
                    $formatted[$attribute] = array($dataType => $value);
                } else {
                    $formatted[$attribute] = array('Value' => array($dataType => $value));
                }
            } else {
                $formatted[$attribute] = Attribute::factory($value)->getFormatted($format);
            }
        }

        return $formatted;
    }
131631
public function getEntityClassName()
    {
        if (null == $this->entityClass) {
            $this->setEntityClass(get_class($this->getEntity()));
        }
        return $this->entityClass;
    }
1323694
protected function _getEntityClassName($entity)
    {
        if (is_object($entity)) {
            $className = get_class($entity);
        } else {
            $className = $entity;
        }
        return $className;
    }
471537
public static String getOrderByClause(Class<?> entityClass) {
        EntityTable table = getEntityTable(entityClass);
        if (table.getOrderByClause() != null) {
            return table.getOrderByClause();
        }

        List<EntityColumn> orderEntityColumns = new ArrayList<EntityColumn>();
        for (EntityColumn column : table.getEntityClassColumns()) {
            if (column.getOrderBy() != null) {
                orderEntityColumns.add(column);
            }
        }

        Collections.sort(orderEntityColumns, new Comparator<EntityColumn>() {
            @Override
            public int compare(EntityColumn o1, EntityColumn o2) {
                return o1.getOrderPriority() - o2.getOrderPriority();
            }
        });

        StringBuilder orderBy = new StringBuilder();
        for (EntityColumn column : orderEntityColumns) {
            if (orderBy.length() != 0) {
                orderBy.append(",");
            }
            orderBy.append(column.getColumn()).append(" ").append(column.getOrderBy());
        }
        table.setOrderByClause(orderBy.toString());
        return table.getOrderByClause();
    }
283225
public function loadEntityDefinitions($itemClass)
	{
		$entities = array();
		$annotations = $this->reader->getClassAnnotations(new \ReflectionClass($itemClass));
		foreach($annotations as $annotation)
		{
			if($annotation instanceof ItemEntity)
			{
				/* @var $annotation \Emhar\SearchDoctrineBundle\Mapping\Annotation\ItemEntity */
				$entity = array();
				$entity['entityClass'] = $annotation->getEntityClass();
				$entity['label'] = $annotation->getLabel();
				$entities[$annotation->getIdentifier()] = $entity;
			}
		}
		return $entities;
	}
769047
private function getClass($entity)
    {
        if (is_object($entity)) {
            return get_class($entity);
        }

        if (class_exists($entity)) {
            return $entity;
        }

        $realClassName = $this->classnameResolver->resolveFullQualifiedClassname($entity);

        return $realClassName;
    }