Returns the EntityMeta for specific or general type

Attention: When type is specific $dc is not optional!
@return Psc\CMS\EntityMeta
489070
public function getEntityMeta(EntityMetaProvider $entityMetaProvider = NULL) {
    if (!isset($this->entityMeta) && $this->type === self::SPECIFIC) {
      if (!isset($entityMetaProvider)) throw new \LogicException('Missing Parameter 1 (EntityMetaProvider) for '.__FUNCTION__);
      
      $this->entityMeta = $entityMetaProvider->getEntityMeta($this->entity->getEntityName());
    }
    
    return $this->entityMeta;
  }
408238
public function getEntityRepository()
    {
        $repository = $this->entityManager->getRepository($this->getEntityName());

        if (!($repository instanceof EntityRepository)) {
            throw new InvalidEntityNameException($this->getEntityName(), $this->getEntityClass());
        }

        return $repository;
    }
610042
public function dpi(EntityMeta $entityMeta, DCPackage $dc) {
    $this->entityMeta = $entityMeta;
    $this->dc = $dc;
    return $this;
  }
522231
public function getPropertyType() {
    if ($this->valueType === self::COLLECTION_VALUED) {
      return new PersistentCollectionType($this->gClass);
    } else {
      return new EntityType($this->gClass);
    }
  }
616987
public function getEntityBuilder($className = null, ClassMetadata $classMetadata = null)
    {
        $builder = new Entity\Builder($this->getMapper(), $this->getFieldManager());

        if ($className !== null) {
            $builder->setClass($className);
        }

        if ($classMetadata !== null) {
            $builder->setClassMetadata($classMetadata);
        }

        return $builder;
    }
323205
protected function getContentTypeDomainMapper()
    {
        if ($this->contentTypeDomainMapper !== null) {
            return $this->contentTypeDomainMapper;
        }

        $this->contentTypeDomainMapper = new Helper\ContentTypeDomainMapper(
            $this->persistenceHandler->contentTypeHandler(),
            $this->persistenceHandler->contentLanguageHandler(),
            $this->getFieldTypeRegistry()
        );

        return $this->contentTypeDomainMapper;
    }
1153280
public function getPrimaryKeyMetadata(): ?ColumnMetadata
    {
        $filteredColumnList = array_filter($this->columnMetadataList, function (ColumnMetadata $columnMetadata) {
            return $columnMetadata->isPrimaryKey();
        });

        return (count($filteredColumnList)) ? current($filteredColumnList) : null;
    }
419939
public function getEntityLink()
    {
        if ($this->EntityURL) {
            return $this->dbObject('EntityURL')->URL();
        }
        
        if ($this->EntityPageID) {
            return $this->EntityPage()->Link();
        }
    }
457817
public function getEntity(): ?string
    {
        $reflection = new ReflectionMethod($this, 'transform');
        if (! $reflection->getNumberOfParameters()) {
            return null;
        }

        $parameter = $reflection->getParameters()[0];
        if (! ($type = $parameter->getType())) {
            return null;
        }

        return $type->getName();
    }
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];
    }
769103
public function getEntityClass()
    {
        if (!$this->_entityClass) {
            $default = Entity::class;
            $self = get_called_class();
            $parts = explode('\\', $self);

            if ($self === __CLASS__ || count($parts) < 3) {
                return $this->_entityClass = $default;
            }

            $alias = Inflector::classify(Inflector::underscore(substr(array_pop($parts), 0, -5)));
            $name = implode('\\', array_slice($parts, 0, -1)) . '\\Entity\\' . $alias;
            if (!class_exists($name)) {
                return $this->_entityClass = $default;
            }

            $class = App::className($name, 'Model/Entity');
            if (!$class) {
                throw new MissingEntityException([$name]);
            }

            $this->_entityClass = $class;
        }

        return $this->_entityClass;
    }
846304
public function getTargetDefinition() {
		if($this->targetDefinition)
			return $this->targetDefinition;

		if(isset($this->params['entities']))
			$entityClass = $this->params['entities'][0];
		else
			$entityClass = $this->params['entity'];

		return $this->definition->getEntityManager()->get($entityClass);
	}
898026
public function process()
    {
        $entityDefs = $this->getEntityDefs(true);

        $ormMetadata = array();
        foreach($entityDefs as $entityName => $entityMetadata) {

            if (empty($entityMetadata)) {
                $GLOBALS['log']->critical('Orm\Converter:process(), Entity:'.$entityName.' - metadata cannot be converted into ORM format');
                continue;
            }

            $ormMetadata = Util::merge($ormMetadata, $this->convertEntity($entityName, $entityMetadata));
        }

        $ormMetadata = $this->afterProcess($ormMetadata);

        return $ormMetadata;
    }
256096
public function getAllMetadata()
    {
        if (!$this->metadataLoaded) {
            // We have to load all the metadata
            $doctrineMetadata = $this->doctrine->getManager()->getMetadataFactory();

            /** @var ClassMetadata $doctrineClassMetadata */
            foreach ($doctrineMetadata->getAllMetadata() as $doctrineClassMetadata) {
                $reflectionClass = $doctrineClassMetadata->getReflectionClass();
                $this->metadata[$reflectionClass->getName()] = $this->getClassMetadata($reflectionClass);
            }

            $this->metadataLoaded = true;
        }

        $allMetadata = array_filter($this->metadata, function($element) { return null !== $element; });

        return $allMetadata;
    }
769879
public static function getEntityManager() {
		if (self::$_entityManager == null) {
			self::$_entityManager = self::_getInstance ();
		}
		return self::$_entityManager;
	}
218895
public function getEntity()
    {
        if ($this->entity == false) {
            $config = $this->getDI()->get('config');
            $model = $this->getModel();
            $searchHelper = $this->getSearchHelper();
            $entity = $config['namespaces']['entities'] . $this->getControllerName('singular') . 'Entity';
            $entityPath = $config['application']['entitiesDir'] . $this->getControllerName('singular') . 'Entity.php';
            $defaultEntityNameSpace = $config['namespaces']['defaultEntity'];

            //check for file, otherwise load generic entity - it should work just fine
            if (file_exists($entityPath)) {
                $entity = new $entity($model, $searchHelper);
            } else {
                $entity = new $defaultEntityNameSpace($model, $searchHelper);
            }
            $this->entity = $this->configureEntity($entity);
        }
        return $this->entity;
    }
468452
protected function loadEntity()
    {
        $params = array_merge($this->params()->fromPost(), $this->params()->fromRoute());
        if (empty($params['id'])) {
            throw new EntityNotFoundException('Bad Request');
        }

        $objectManager = $this->getServiceLocator()->get('Doctrine\ORM\EntityManager');

        if (!$model = $objectManager->getRepository(get_class($this->getEntity()))->find($params['id'])) {
            throw new EntityNotFoundException('Entity not found');
        }
        return $model;
    }