Returns an array of items for a page.

@param int $offset
@param int $itemCountPerPage

@return array
329946
public function getItems($offset, $itemCountPerPage)
    {
        $paginator = $this->getPaginator();
        if ($paginator instanceof Doctrine2Paginator) {
            $this->getQueryBuilder()
                ->setFirstResult($offset)
                ->setMaxResults($itemCountPerPage);

            return $paginator->getIterator()->getArrayCopy();
        } else {
            return $paginator->getItems($offset, $itemCountPerPage);
        }
    }
149224
protected function getProjectList($page = 1, $perPage= 100)
    {
        $listRaw = $this->client->projects->accessible($page, $perPage);
        $list = [];
        foreach ($listRaw as $item) {
            if (array_get($item, 'namespace.name') === $this->namespace) {
                $list[] = $item;
            }
        }

        return $list;
    }
815325
public function get_items( $priority = 1000, $user_id = 0 ) {
		// Get the current author ID, if not specified.
		if ( ! $user_id ) {
			$user_id = get_queried_object_id();
		}

		// Create the author breadcrumb item.
		$item = Carbon_Breadcrumb_Item::factory( $this->get_type(), $priority );
		$item->set_id( $user_id );
		$item->setup();

		return array( $item );
	}
496695
public List<O> getItems(int count, int offset) {
        return getDatastore().find(clazz).offset(offset).limit(count).asList();
    }
1102971
public static function getTwoTablePagination(int $table1Count, int $table2Count, int $limit, int $offset = 0): array
    {
        \assert('$table1Count >= 0 && $table2Count >= 0 && $limit >= 0 && $offset >= 0');
        $offset1 = min($offset, $table1Count);
        $limit1 = min($limit, $table1Count - $offset1);
        $offset2 = min($offset - $offset1, $table2Count);
        $limit2 = min($limit - $limit1, $table2Count - $offset2);
        return [
            'limit1' => $limit1,
            'offset1' => $offset1,
            'limit2' => $limit2,
            'offset2' => $offset2,
        ];
    }
606860
public function slice(int $offset, ?int $length = null): ArrayCollection
    {
        return new static(array_slice($this->items, $offset, $length, true));
    }
366505
public function getSlice($offset, $length): array
    {
        $query = clone $this->query;
        $query->offset = $offset;
        $query->limit = $length;
        $query->performCount = false;

        $trashItems = $this->trashService->findTrashItems($query);

        if (null === $this->nbResults && null !== $trashItems->count) {
            $this->nbResults = $trashItems->count;
        }

        return $trashItems->items;
    }
588134
public function offsetGet($offset)
    {
        return $this->offsetExists($offset) ? array_get($this->items, $offset) : null;
    }
196247
public function paginate($page, $itemsOnPage = 30)
    {
        $paginator = new Paginator($this);
        return $paginator
            ->setCurrentPage($page)
            ->setItemsOnPage($itemsOnPage);
    }
1106826
public function getPosts($limit = false, $offset = false)
    {
        if (!$limit) {
            $limit = Option::get('posts_per_page');
        }
        return Post::getByAuthor($this->ID, $limit, $offset);
    }
1074409
public function offsetGet($offset) {
    return isset($this->__items[$offset]) ? $this->__items[$offset] : null;
  }
138775
public function getSurveys($page = 1, $resultsPerPage = self::RESULTS_PER_PAGE, $sortBy = 'title', $sortOrder = 'DESC',
                               $title = null, \DateTime $startModifiedAt = null, \DateTime $endModifiedAt = null)
    {
        $params = array(
            'page' => $page,
            'per_page' => $resultsPerPage,
            'sort_by' => $sortBy,
            'sort_order' => $sortOrder,
        );

        $this->appendQueryParameter($params, 'title', $title);
        $this->appendQueryParameter($params, 'start_modified_at', $startModifiedAt, 'format', 'YYYY-MM-DDTHH:SS');
        $this->appendQueryParameter($params, 'end_modified_at', $endModifiedAt, 'format', 'YYYY-MM-DDTHH:SS');

        $response = $this->client->run('/surveys', HTTPMethod::GET, $params);

        if($response->isError()) {
            return $response;
        }

        return new ListResponse($response->getResponse(), $this->getClient(), Survey::class);
    }
715215
public function page(int $page, int $perPage): ArrayCollection
    {
        return $this->slice(($page - 1) * $perPage, $perPage);
    }
1373578
public final function getItemIds($count = null, $offset = null)
    {
        $select = $this->_getSelect();
        if (!$select) return array();

        if ($count) {
            if ($select->hasPart(Kwf_Model_Select::LIMIT_COUNT)) {
                $ex = new Kwf_Exception("Can't use getItemIds with limit in select when \$count paramter is given. You probably should disable paging for {$this->getData()->componentClass}.");
                $ex->logOrThrow();
            }
            $select->limit($count, $offset);
        }

        return $this->getData()->parent->getComponent()->getItemIds($select);
    }
685297
protected function prepareObjectsSlice($itemsPerPage, $offset)
    {
        if ($this->objects instanceof QueryResultInterface) {
            $currentRange = $offset + $itemsPerPage;
            $endOfRange = \min($currentRange, \count($this->objects));
            $query = $this->objects->getQuery();
            $query->setLimit($itemsPerPage);
            if ($offset > 0) {
                $query->setOffset($offset);
                if ($currentRange > $endOfRange) {
                    $newLimit = $endOfRange - $offset;
                    $query->setLimit($newLimit);
                }
            }
            $modifiedObjects = $query->execute();

            return $modifiedObjects;
        }
        if ($this->objects instanceof ObjectStorage) {
            $modifiedObjects = [];
            $objectArray = $this->objects->toArray();
            $endOfRange = \min($offset + $itemsPerPage, \count($objectArray));
            for ($i = $offset; $i < $endOfRange; ++$i) {
                $modifiedObjects[] = $objectArray[$i];
            }

            return $modifiedObjects;
        }
        if (\is_array($this->objects)) {
            $modifiedObjects = \array_slice($this->objects, $offset, $itemsPerPage);

            return $modifiedObjects;
        }
        throw new \InvalidArgumentException(
            'The view helper "' . static::class
            . '" accepts as argument "QueryResultInterface", "\SplObjectStorage", "ObjectStorage" or an array. '
            . 'given: ' . \get_class($this->objects),
            1385547291
        );
    }
1039788
public function itemListAction($userId, $page, $user)
    {
        $isOwner = false;
        if ($user->getId() == $userId) {
            $isOwner = true;
        }
        $likesQB = $this->getWallItemManager()->getWallItemsForPagination($userId, $isOwner);
        $pager = $this->paginateQuery($likesQB, $page);

        return array(
            'pager' => $pager,
            'userId' => $userId,
            'isOwner' => $isOwner, );
    }
305993
public function getRecommendedItems($userId, $itemCount = 3)
    {
        $response = $this->sendQuery(['user' => $userId, 'num' => intval($itemCount)]);

        return $response;
    }