This method returns Context Entities

@param mixed $type Selected Type
@param mixed $offset
@param mixed $limit
@param mixed $details
@return  Entities object
327474
public function getEntities($type = false, $offset = 0, $limit = 1000, $details = "on") {
        if ($type) {
            $url = $this->url . "contextTypes/" . $type;
        } else {
            $url = $this->url . "contextEntities/";
        }

        $ret = $this->restRequest($url . "?offset=$offset&limit=$limit&details=$details", 'GET')->getResponseBody();
        $Context = (new Context\Context($ret))->get();
        $Entities = [];
        
        if($Context instanceof \stdClass && isset($Context->errorCode)){
            switch ((int) $Context->errorCode->code) {
                case 404:
                case 500:
                    throw new Exception\GeneralException($Context->errorCode->reasonPhrase,(int)$Context->errorCode->code, null, $ret);
                default:
                case 200:
                    break;
            }
        }else{
            throw new Exception\GeneralException("Malformed Orion Response",500, null, $ret);
        }
        
        if(isset($Context->contextResponses) && count($Context->contextResponses) > 0){
            foreach ($Context->contextResponses as $entity) {
                $t = $entity->contextElement->type;
                $id = $entity->contextElement->id;
                
                if(!array_key_exists($t, $Entities)){
                    $Entities[$t] = [];
                }
                $Entities[$t][$id] = $entity->contextElement->attributes;
            }
        }




        return new Context\Context($Entities);
    }
1288893
public function getItems($offset, $limit) {
		$this->select->limit($limit, $offset);
		
		return $this->datagate->fetchAll($this->select);
	}
755908
public function retrieveAll(array $filters = array(), $limit = null, $offset = null)
    {
        $result = clone $this->entityCollection;
        if (!empty($filters)) {
            $result = $result->search($filters);
        }
        if ($offset) {
            $result = $result->cslice($offset, $limit);
        }
        if ($limit && !$offset) {
            $result = $result->chunk($limit);
        }

        return $result;
    }
1211847
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
    {
        // Check if we have to filter or sort by an encrypted field
        if ($this->filterHasEncryptedField($criteria) || $this->orderByHasEncryptedField($orderBy)) {
            return $this->filterAndSortByEncryptedField($criteria, $orderBy, $limit, $offset);
        }
        else {
            // We can use the usual repository logic
            $entities = $this->wrapped->findBy($criteria, $orderBy, $limit, $offset);
            return $entities;
        }
    }
758887
public function loadRecent(
        $limit = ArticleViewDocumentRepository::DEFAULT_LIMIT,
        array $types = null,
        $locale = null,
        $ignoreWebspaces = false
    ) {
        $excludeUuid = null;

        /** @var Request $request */
        $request = $this->requestStack->getCurrentRequest();

        $articleDocument = $request->get('object');
        if ($articleDocument instanceof ArticleDocument) {
            $excludeUuid = $articleDocument->getUuid();

            if (!$types) {
                $types = [$this->getArticleType($articleDocument)];
            }
        }

        if (!$locale) {
            $locale = $request->getLocale();
        }

        $webspaceKey = $this->getWebspaceKey($request, $ignoreWebspaces);

        $articleViewDocuments = $this->articleViewDocumentRepository->findRecent(
            $excludeUuid,
            $limit,
            $types,
            $locale,
            $webspaceKey
        );

        return $this->getResourceItems($articleViewDocuments);
    }
115568
public function loadAllLocations($offset, $limit)
    {
        $this->logger->logCall(__METHOD__, array('offset' => $offset, 'limit' => $limit));

        return $this->persistenceHandler->locationHandler()->loadAllLocations($offset, $limit);
    }
1211029
public function getReference($data, $type)
    {
        $index = array_search($data, $this->store[$type], true);
        if ($index !== false) {
            return $index;
        }

        if (!$this->validate($data)) {
            return false;
        }

        $this->addReference($data, $type);
        return false;
    }
547784
public function getByType(Type $type)
    {
        $sites = $this->entityManager->getRepository('Concrete\Core\Entity\Site\Site')
            ->findByType($type);
        $return = [];
        foreach ($sites as $site) {
            $factory = new Factory($this->config);
            $return[] = $factory->createEntity($site);
        }

        return $return;
    }
1047026
protected function getThing($typeof, $resourceId, ContextInterface $context)
    {
        /** @var TypeInterface[] $types */
        $types = [];
        if (strlen($typeof)) {
            foreach (preg_split('/\s+/', $typeof) as $prefixedType) {
                $types[] = $this->getType($prefixedType, $context);
            }
        }

        return new Thing($types, $resourceId);
    }
91386
public function getGenericResources($limit = 10, $mode = AbstractQuery::HYDRATE_OBJECT)
    {
        $builder = $this->getEntityManager()->createQueryBuilder();

        $builder->select('e')
            ->from($this->getEntity(), 'e')
            ->where('e.isGeneric = 1')
            ->setMaxResults($limit);

        $query = LocaleAwareTrait::addHints($builder->getQuery());

        return $query->execute($mode);
    }
1225283
public function getMemberInfo($limit = null, $offset = 0, $memberRoleFilter = null, $memberInfoFilter = null, $appDefinedDataFilter = null)
    {
        $request = new GetGroupMemberInfoRequest($this->groupId, $limit, $offset, $memberRoleFilter, $memberInfoFilter, $appDefinedDataFilter);
        $response = new GetGroupMemberInfoResponse();
        return $this->client->sendRequest($request, $response);
    }
1327499
public function findAllPaginated($offset = null, $limit = null)
    {
        $qb = $this
            ->createQueryBuilder('w')
            ->orderBy('w.id')
            ->setMaxResults($limit);
        if ($offset) {
            $qb->setFirstResult($offset);
        }

        return $qb->getQuery()->getResult();
    }
1287187
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
    {
        $persister = $this->entityManager->getEntityPersister($this->className);

        return $persister->loadAll($criteria, $orderBy, $limit, $offset);
    }
167645
private static function fetchByConditions( $conditions, $limit, $offset )
    {
        $db = eZDB::instance();

        $defaultConditions = array(
            'ezcobj_state.group_id=ezcobj_state_group.id',
            'ezcobj_state_language.contentobject_state_id=ezcobj_state.id',
            eZContentLanguage::languagesSQLFilter( 'ezcobj_state' ),
            eZContentLanguage::sqlFilter( 'ezcobj_state_language', 'ezcobj_state' )
        );

        $conditions = array_merge( $conditions, $defaultConditions );

        $conditionsSQL = implode( ' AND ', $conditions );

        $sql = "SELECT ezcobj_state.*, ezcobj_state_language.* " .
               "FROM ezcobj_state, ezcobj_state_group, ezcobj_state_language " .
               "WHERE $conditionsSQL " .
               "ORDER BY ezcobj_state.priority";

        $rows = $db->arrayQuery( $sql, array( 'limit' => $limit, 'offset' => $offset ) );

        $states = array();
        foreach ( $rows as $row )
        {
            $state = new eZContentObjectState( $row );
            $stateLanguage = new eZContentObjectStateLanguage( $row );
            $state->setLanguageObject( $stateLanguage );
            $states[] = $state;
        }

        return $states;
    }
862156
public function getByReference($reference, $type)
    {
        if (!isset($this->store[$type])) {
            return false;
        }

        $count = count($this->store[$type]);

        if ($reference >= $count) {
            throw new DeserializationException('Invalid ' . $type . ' reference: ' . $reference);
        }

        if (!$count) {
            return false;
        }

        return $this->store[$type][$reference];
    }
777446
public function fetchEntity(AnCommandContext $context)
    {
        if (!$this->_entity) {
            if ($entity = $this->getService('com:settings.domain.entity.template')->load($this->alias)) {
                $this->_entity = $entity;
            }
        }

        return $this->_entity;
    }
989527
private function getPropertiesByType($entity, $type)
    {
        $properties = $this->readClassProperties($entity);

        $fields = [];
        foreach ($properties as $property) {
            $annotation = $this->reader->getPropertyAnnotation($property, $type);

            if (null === $annotation) {
                continue;
            }

            $property->setAccessible(true);
            $annotation->value = $property->getValue($entity);
            $annotation->name = $property->getName();

            $fields[] = $annotation;
        }

        return $fields;
    }