get a real entity (with all parameters)

@access public
@param  object $oEntity entity that we want analyze
@return mixed
516820
public static function getPrimaryKeyNameWithoutMapping($oEntity)
	{
		$aEntitieSetup = array();

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

		foreach ($oProperties as $oProperty) {

			$sDoc = $oProperty->getDocComment();

			if (strstr($sDoc, '@primary_key')) {

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

		if (count($aEntitieSetup) == 0) { return false; }
		else if (count($aEntitieSetup) == 1) { return $aEntitieSetup[0]; }
		else { return $aEntitieSetup; }
	}
1205026
public function getEntity($id = 0)
    {
        try {
            $q = $this->createQueryBuilder($this->getTableAlias());
            if (is_array($id)) {
                $this->buildSelectClause($q, $id);
                $extendedFieldId = $id['id'];
            } else {
                $extendedFieldId = $id;
            }
            $idArray   = explode('@', $extendedFieldId);
            $leadId    = isset($idArray[0]) && !is_null($idArray[0]) ? $idArray[0] : null;
            $leadField = isset($idArray[1]) && !is_null($idArray[1]) ? $idArray[1] : null;
            $q->andWhere($this->getTableAlias().'.lead = '.$leadId);
            $q->andWhere($this->getTableAlias().'.leadField = '.$leadField);
            $entity = $q->getQuery()->getSingleResult();
        } catch (\Exception $e) {
            $entity = null;
        }

        if (null != $entity && isset($extendedFieldId)) {
            // @todo - likely needs refactoring...
            $fieldValues = $this->getFieldValues($extendedFieldId, true, 'extendedField');
            $entity->setFields($fieldValues);
        }

        return $entity;
    }
498325
protected function getEntity() {
		if (! $this->_entity) {
			if ($this->getDataTable()) {
				$this->_entity = $this->getDataTable()->getEntity();
			}
		}
		return $this->_entity;
	}
777911
protected function getEntityParams($entityName = null, $isOrmEntityDefs = false, $returns = null)
    {
        if (!isset($entityName)) {
            $entityName = $this->getEntityName();
        }

        $entityDefs = $this->getDefs($isOrmEntityDefs);

        if (isset($entityDefs[$entityName])) {
            return $entityDefs[$entityName];
        }

        return $returns;
    }
729791
public function fetchId($entity) {
        $id = null;
        $idProperty = $this->fetchIdProperty(new \ReflectionClass($entity));
        if ($idProperty) {
            $idProperty->setAccessible(TRUE);
            $id = $idProperty->getValue($entity);
        }
        return $id;
    }
891069
public function findFor(AbstractEntity $entity)
    {
        return $this->findOneBy(array('refId' => $entity->getId(), 'refEntityName' => ClassLookup::getClass($entity)));
    }
815867
protected function getEntity($entityId)
    {
        $entity = $this->getRepository()->get($entityId);
        if (!$entity instanceof EntityInterface) {
            throw new EntityNotFoundException(
                "There are no entities with provided entity ID."
            );
        }
        return $entity;
    }
410011
public function getPositionFieldByEntity($entity)
	{
		if (is_object($entity)) {
			$entity = \Doctrine\Common\Util\ClassUtils::getClass($entity);
		}

		if (isset($this->positionField['entities'][$entity])) {
			return $this->positionField['entities'][$entity];
		} else {
			return $this->positionField['default'];
		}
	}
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;
    }
573648
public function getEntity($id = null)
    {
        if (null === $id) {
            $entity           = new ContactSource();
            $defaultUtmSource = $this->getRepository()->getDefaultUTMSource();
            $entity->setUtmSource($defaultUtmSource);

            return $entity;
        }

        if ('clone' == $this->dispatcher->getContainer()->get('request')->attributes->get('objectAction')) {
            $entity           = parent::getEntity($id);
            $defaultUtmSource = $this->getRepository()->getDefaultUTMSource();
            $entity->setUtmSource($defaultUtmSource);

            return $entity;
        }

        return parent::getEntity($id);
    }
1231466
private E getEntity(Object entity)
    {
        return (E) (entity.getClass().isAssignableFrom(EnhanceEntity.class) ? ((EnhanceEntity) entity).getEntity()
                : entity);
    }
1341669
public static function getEntityObject($objType, $objID=null) {
		if( is_object($objType) ) {
			$objID		= $objType->entity_id;
			$objType	= $objType->entity_type;
		}
		$class = isset(static::$entityClasses[$objType]) ? static::$entityClasses[$objType] : $objType;
		return $class::load($objID);
	}
695864
private function getEntityByClass($className)
    {
        if (!isset($this->entities[ $className ])) {
            $entity                       = new Entity($this, $className);
            $this->entities[ $className ] = $entity;

            $this->metadataDriver->readEntityMetadata($entity);
        }

        return $this->entities[ $className ];
    }
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;
    }
1224572
public function getRepository($entityName)
    {
        $resolvedEntityName = $this->getEntityManager()->getEntityClassByInterface($entityName);
        $objectManager = $this->getObjectManagerAutoDetector()->getObjectManagerByClassName($resolvedEntityName);
        return $objectManager->getRepository($resolvedEntityName);
    }
532319
public function getEntity($entityId)
    {
        if (isset($this->entities[$entityId])) {
            return $this->entities[$entityId];
        }

        $this->entities[$entityId] = $this->client->getEntity($entityId);

        return $this->entities[$entityId];
    }
587766
public function getBySession(SessionEntity $session)
    {
        foreach($this->getDbConnection()->fetchAll(
            'SELECT oc.id, oc.name FROM oauth_client oc
            INNER JOIN oauth_session os ON(oc.id = os.client_id)
            WHERE os.id = :id',
            ['id' => $session->getId()]
        ) as $row) {
            if ($row) {
                return (new ClientEntity($this->server))
                    ->hydrate([
                        'id' => $row['id'],
                        'name' => $row['name']
                    ]);
            }
        }
        return null;
    }