Get the entity.

@return number
551052
public function getEntity()
    {
        //if there is no entity
        if ($this->entity === null) {
            //we try to get one from the proxy
            $entityProxy = $this->getEntityProxy();

            //if there is a proxy
            if ($entityProxy !== null && $this->getBusinessEntityId()) {
                $entity = $entityProxy->getEntity($this->getBusinessEntityId());
                $this->entity = $entity;
            }
        }

        return $this->entity;
    }
1324655
public function getType()
    {
        if ($this->entity->getType()) {
            return new Type($this->entity->getType(), $this->locale);
        }

        return null;
    }
5437
public function getEntityClassAlias()
    {
        if ($this->entityClassAlias === null) {
            $entityClass = $this->getEntityClass();
            $this->setEntityClassAlias(strtolower(substr($entityClass, strrpos($entityClass, '\\')+1, 1)));
        }
        return $this->entityClassAlias;
    }
642790
public function get()
    {
        $uri = null;
        if ($this->context) {
            $uri = $this->context->getBaseUri() . '/';
        }
        $uri .= $this->params['endpoint'];
        
        $uri .= sprintf("?page=%d&perpage=%d"
            , $this->page
            , $this->perpage
            );
        
        // add filter if value is not empty
        foreach ($this->filters as $filter) {
            if (! empty($filter['value'])) {
                $uri .= sprintf("&%s=%s"
                    , $filter['field']
                    , rawurlencode($filter['value'])
                    );
            }
        }
        
        $res = $this->client->call($uri);

        // get and preserve pagination
        $lr = Client::getLastResponse();
        $this->pagination = isset($lr['body']) && isset($lr['body']['pagination']) ? $lr['body']['pagination'] : [];
        
        // convert array to Entities collection
        $this->data = [];
        foreach ($res as $data) {
            $this->data[] = (new Entity([], $this->client))->setData($data);
        }
        $this->current = 0;
        
        return $this->data;
    }
438541
protected function getExtensionEntity()
    {
        if (!isset($this->extensionEntity)) {
            $processId = $this->getProcessId();
            $this->extensionEntity = $this->getEntityManager()->getEntity('Extension', $processId);
            if (!isset($this->extensionEntity)) {
                throw new Error('Extension Entity not found.');
            }
        }

        return $this->extensionEntity;
    }
843714
public function getBusinessEntity()
    {
        //if there is no entity
        if ($this->businessEntity === null) {
            //if there is a proxy
            if ($this->getEntityProxy() !== null) {
                $this->businessEntity = $this->getEntityProxy()->getEntity($this->getBusinessEntityId());

                return $this->businessEntity;
            }
        }

        return $this->businessEntity;
    }
1208705
public function getEntity()
    {
        if (!($this->_entity instanceof Entity)) {
            $class = $this->_entity;
            $this->setEntity(new $class());
        }
        return $this->_entity;
    }
744965
public function getEntityUrl() : string
    {
        $result = Router::url(
            [
                'prefix' => false,
                'controller' => $this->table->getTable(),
                'action' => 'view',
                $this->entity->id
            ],
            true
        );

        return $result;
    }
769879
public static function getEntityManager() {
		if (self::$_entityManager == null) {
			self::$_entityManager = self::_getInstance ();
		}
		return self::$_entityManager;
	}
949892
public function getEntity($entity = null)
    {
        if ($entity === null) {
            $class = $this->class;
            $entity = new $class();
        }

        if ($entity instanceof Content && !$entity->getContenttype() && $ct = $this->getClassMetadata()->getBoltName()) {
            $contentType = $this->metadata->createContentType($ct);
            if ($contentType) {
                $entity->setContenttype($contentType);
            } else {
                $entity->setContenttype($ct);
            }
        }

        return $entity;
    }
933784
public function getEntity()
    {

        // primary key only
        $references = $this->getReferences();

        // debug // print_r( $references->map(function($e){ return $e->get('fullyQualifiedName');}) );
        foreach( $references as $reference ) {

            // only manage references where the reference column is the primary key
            if( $reference->isPrimaryKey() ) {
                return array(
                    'entity' => 'normality',
                    'normality' => $reference->getRelation()->getEntityName(),
                );
            }

        }

        // datatypes we understand and have defined objects for
        // have a helper method in Entity::staticHelper
        switch( $this->getType()->name ) {

            case 'StockState':

                return array (
                    'entity' => 'StockState',
                );

            case 'hstore':

                return array(
                    'entity' => 'Hstore',
                );

            case 'json':

                return array(
                    'entity' => 'Json',
                );

            case 'inet':

                return array(
                    'entity' => 'Inet',
                );

            case 'timestamp':

                return array(
                    'entity' => 'DateTime',
                );

            case 'tsrange':

                return array(
                    'entity' => 'DateRange',
                );

            case 'oid':

                return array(
                    'entity' => 'PgLargeObject',
                );

        }

        return array();

    }
481586
protected function getEntityGenerator()
    {
        $entityGenerator = new EntityGenerator();
        $entityGenerator->setFieldVisibility(EntityGenerator::FIELD_VISIBLE_PROTECTED);
        $entityGenerator->setGenerateAnnotations(false);
        $entityGenerator->setGenerateStubMethods(true);
        $entityGenerator->setRegenerateEntityIfExists(false);
        $entityGenerator->setUpdateEntityIfExists(true);
        $entityGenerator->setNumSpaces(4);
        $entityGenerator->setAnnotationPrefix('ORM\\');

        if ($this->configuration['with_interface']) {
            $entityGenerator->setClassToInterface($this->configuration['namespace'] . '\\' . $this->model.'Interface');
        }

        return $entityGenerator;
    }
17867
public function getEntityIdAttribute()
    {
        if ($this->attributes['data'] == '' || $this->attributes['type'] != 'entity')
            return null;

        $data = unserialize($this->attributes['data']);

        if (!isset($data['entity_type']))
            return null;
        else {
            $entity_type = explode(':', $data['entity_type']);

            return isset($entity_type[1]) ? $entity_type[1] : null;
        }
    }
854055
public function getData()
    {
        $data = [];

        // Paginator is better if the query uses ManyToMany associations
        $result = $this->qb->getMaxResults() !== NULL || $this->qb->getFirstResult() !== NULL
            ? new Paginator($this->getQuery())
            : $this->qb->getQuery()->getResult();

        foreach ($result as $item) {
            // Return only entity itself
            $data[] = is_array($item)
                ? $item[0]
                : $item;
        }

        return $data;
    }
399799
public function getDescriptor()
    {
        if (null == $this->descriptor) {
            $this->setDescriptor(
                EntityDescriptorRegistry::getInstance()
                    ->getDescriptorFor($this->getEntityClassName())
            );
        }
        return $this->descriptor;
    }
763120
public function getRepository()
    {
        if ($this->repository === null) {
            $this->repository = $this->entityManager->getRepository($this->entityName);
        }

        return $this->repository;
    }
416263
public function getType()
    {
        if ($this->entity && $this->entity->getType()) {
            return new OrderType($this->entity->getType(), $this->locale);
        } else {
            return null;
        }
    }