@param string $entityClass Entity class

@return array
548712
private function getNewObjectFlagMeta($entityClass)
    {
        $meta = $this->extendedMetadataFactory->getExtendedMetadata($entityClass);

        return isset($meta['newObjectFlag']) ? $meta['newObjectFlag'] : [];
    }
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;
    }
1151627
protected function buildEntityService(string $modelClass): IEntityService
    {
        try {
            if (isset($this->registeredServices[$modelClass])) {
                return $this->container->make($this->registeredServices[$modelClass]);
            }

            return $this->container->make(EntityService::class, [
                'className' => $modelClass,
                'repository' => $this->repositoryFactory->getRepository($modelClass),
            ]);
        } catch (RepositoryException $exception) {
            throw new EntityServiceException($exception->getMessage(), $exception->getCode(), $exception);
        }
    }
599490
private function getCustomObjectMeta($entityClass)
    {
        if (!array_key_exists($entityClass, $this->customObjectMeta)) {
            $meta = $this->extendedMetadataFactory->getExtendedMetadata($entityClass);

            $this->customObjectMeta[$entityClass] = isset($meta['customObjects']) && !empty($meta['customObjects'])
                ? $meta['customObjects']
                : null;
        }

        return $this->customObjectMeta[$entityClass];
    }
36137
public static function createEntities($entityClass, $dataArray)
    {
        return array_map(function ($data) use ($entityClass) {
            return static::createEntity($entityClass, $data);
        }, $dataArray);
    }
218746
private function createDataMapper($entityClass)
    {
        /** @var DataMapperInterface $dataMapper */
        $dataMapperClass = isset($this->config['dataMapper']) ? $this->config['dataMapper'] : DoctrineDataMapper::class;

        $meta = $this->builder->getMeta($entityClass);

        if ($meta->storage['type'] == 'api') {
            $dataMapperClass = $meta->storage['handler'];
        }

        switch ($dataMapperClass) {
            case CsvDataMapper::class:
                $connectionClass = CsvDataGateway::class;

                break;

            default:
                $connectionClass = Connection::class;

                break;
        }

        $dataMapper = new $dataMapperClass(
            $this->getConnection($connectionClass),
            $entityClass,
            $meta->storage['table'],
            $this->entityRegistry
        );

        if ($dataMapper instanceof DispatcherAwareInterface) {
            $dataMapper->setDispatcher($this->getDispatcher());
        }

        return $dataMapper;
    }
514267
public function getIdentifiers($class)
    {
        $schema = $this->getSchema($class);

        if (isset($schema->claroline)) {
            return $schema->claroline->ids;
        }

        return [];
    }
434589
private function getAnnotations($class)
    {
        $parsed = $this->getParser()->parse($class);
        if (!is_array($parsed)) {
            return [];
        }
        $context = [
            'class' => $class,
            'declaringClass' => $class,
            'type' => Context::TYPE_CLASS,
            'name' => $class
        ];
        $annotations = [];
        if (!empty($parsed['class'])) {
            foreach ($parsed['class'] as $value) {
                $anno = $this->create($value, $context);
                if ($anno) {
                    $annotations[] = $anno;
                }
            }
        }
        $map = [
            'methods' => Context::TYPE_METHOD,
            'properties' => Context::TYPE_PROPERTY
        ];
        $reflection = new \ReflectionClass($class);
        foreach ($map as $type_name => $type) {
            if (!empty($parsed[$type_name])) {
                foreach ($parsed[$type_name] as $name => $values) {
                    $reflType = $type == 'method' ? $reflection->getMethod($name)
                               : $reflection->getProperty($name);
                    $context['type'] = $type;
                    $context['name'] = $name;
                    $context['declaringClass'] = $reflType->getDeclaringClass()->getName();
                    foreach ($values as $value) {
                        $anno = $this->create($value, $context);
                        if ($anno) {
                            $annotations[] = $anno;
                        }
                    }
                }
            }
        }
        return $annotations;
    }
1207323
public function get(string $class, string $identity)
    {
        if (!$this->has($class, $identity)) {
            return null;
        }

        return $this->entities["{$class}:{$identity}"];
    }
396000
public function getDataMapperForEntity($entityClass)
    {
        Assertion::keyIsset($this->entityDataMapperMap, $entityClass, sprintf(
            "Could not find data mapper service name for entity class '%s'",
            $entityClass
        ));

        $entityDMServiceName = $this->entityDataMapperMap[$entityClass];

        $dataMapper = $this->get($entityDMServiceName);

        if (! is_a($dataMapper->getEntityClass(), $entityClass, true)) {
            throw new Exception\RuntimeException(sprintf(
                '"%s" entity class mismatch: expected "%s", got "%s"',
                $entityDMServiceName,
                $entityClass,
                $dataMapper->getEntityClass()
            ));
        }

        return $dataMapper;
    }
916214
private function getEntityTypeInfo($class)
    {
        $entityType = $this->getEntityType($class);

        if (!$entityType) {
            return [null, null];
        }

        $info = entity_get_info($entityType);

        if (!$info) {
            return [null, null];
        }

        return [$entityType, $info];
    }
317912
protected function getEntityMapInstanceFromCache(string $entityClass)
    {
        if ($this->cache == null) {
            return;
        }

        if ($this->cache->has($entityClass)) {
            return unserialize($this->cache->get($entityClass));
        }
    }
365566
private function getDoctrineMetadata($entityClass)
    {
        if (!isset($this->doctrineMetadata[$entityClass])) {
            try {
                $this->doctrineMetadata[$entityClass] = $this->em->getClassMetadata($entityClass);
            } catch (MappingException $ex) {
                throw new FiltererException(sprintf('Unable to get Doctrine metadata for class "%s".', $entityClass));
            }
        }

        return $this->doctrineMetadata[$entityClass];
    }
1162385
public function toRecords(string $recordClass): array
    {
        $array = [];
        foreach ($this->rows as $row) {
            /**
             * @var $row Row
             */
            $record = Record::instanceRecord($recordClass, $row->toArray());
            $record->setLoaded();
            $array[] = $record;
        }
        return $array;
    }
716955
public function getAllClasses(core_kernel_classes_Class $rootClass)
    {
        $result = [
            'uri'      => $rootClass->getUri(),
            'label'    => $rootClass->getLabel(),
            'children' => $this->getSubClasses($rootClass->getSubClasses(false))
        ];

        return $result;
    }
437695
protected function loadResource(string $entityClass, string $rel)
    {
        $uri = $this->resource->getLinks()->getHref($rel);

        return $this->restClient->getResource($entityClass, $uri)->getEntity();
    }
962480
public function getForm($entityClass = null)
    {
        if (null === $entityClass) {
            $entityClass = $this->getEntityClass();
        }

        $builder = new AnnotationBuilder();
        $form = $builder->createForm($entityClass);

        $hasEntity = false;
        foreach ($form->getElements() as $element) {
            if (method_exists($element, 'setObjectManager')) {
                $element->setObjectManager($this->getEntityManager());
                $hasEntity = true;
            } elseif (method_exists($element, 'getProxy')) {
                $proxy = $element->getProxy();
                if (method_exists($proxy, 'setObjectManager')) {
                    $proxy->setObjectManager($this->getEntityManager());
                    $hasEntity = true;
                }
            }
        }

        if ($hasEntity) {
            $hydrator = new DoctrineHydrator($this->getEntityManager(), $entityClass);
            $form->setHydrator($hydrator);
        } else {
            $form->setHydrator(new ClassMethods());
        }

        $form->add([
            'type' => 'Zend\Form\Element\Csrf',
            'name' => 'csrf',
            'attributes' => [
                'id' => 'csrf',
            ],
        ]);

        $submitElement = new \Zend\Form\Element\Button('submit');
        $submitElement->setAttributes([
            'type' => 'submit',
            'class' => 'btn btn-primary',
        ]);
        $submitElement->setLabel('Salvar');
        $form->add($submitElement, [
            'priority' => -100,
        ]);

        $cancelarElement = new \Zend\Form\Element\Button('cancelar');
        $cancelarElement->setAttributes([
            'type' => 'button',
            'class' => 'btn btn-default',
            'onclick' => 'top.location=\''.$this->url()
                ->fromRoute($this->getActionRoute('list')).'\'',
        ]);
        $cancelarElement->setLabel('Cancelar');
        $form->add($cancelarElement, [
            'priority' => -100,
        ]);

        return $form;
    }