@param null $limit
@param null $offset

@return array
8271
public function getAllFriendships($limit = null, $offset = null): array
    {
        return $this->findFriendshipsByStatus(null, $limit, $offset);
    }
1197495
public function limit($limit, $offset = null)
    {
        $this->_limit = $limit > 0 ? (int)$limit : null;
        $this->_offset = $offset > 0 ? (int)$offset : null;

        return $this;
    }
396208
public function get($limit = null, $offset = null)
    {
        if (isset($limit)) {
            $this->limit($limit, $offset);
        }

        if (false !== ($result = $this->conn->query($this->builderCache))) {
            $result->setTotalRows($this->countAllResults(true));
        }

        $this->builderCache->reset();

        return $result;
    }
307404
public function loadAllGroups($offset = 0, $limit = -1)
    {
        $data = $this->objectStateGateway->loadObjectStateGroupListData($offset, $limit);

        return $this->objectStateMapper->createObjectStateGroupListFromData($data);
    }
513097
protected function preparePagination(&$offset, &$limit): ?string
    {
        $total   = count($this->images);
        $perPage = $this->get('perPage');

        // Paginate the result of not randomly sorted (see #8033)
        if ($perPage > 0 && $this->get('sortBy') != 'random') {
            // Get the current page
            $parameter = 'page_g' . $this->get('id');
            $page      = (Input::get($parameter) !== null) ? Input::get($parameter) : 1;

            // Do not index or cache the page if the page number is outside the range
            if ($page < 1 || $page > max(ceil($total / $perPage), 1)) {
                throw new PageNotFoundException('Page not found: ' . Environment::get('uri'));
            }

            // Set limit and offset
            $offset = (($page - 1) * $perPage);
            $limit  = min(($perPage + $offset), $total);

            $pagination = new Pagination(
                $total,
                $perPage,
                Config::get('maxPaginationLinks'),
                $parameter
            );

            return $pagination->generate("\n  ");
        }

        return null;
    }
1268599
public function getItems($offset, $limit)
    {
        $this->cursor->skip($offset);
        $this->cursor->limit($limit);

        return iterator_to_array($this->cursor);
    }
681041
public function clientListDb($offset = null, $limit = null)
  {
    return $this->execute("clientdblist -count", array("start" => $offset, "duration" => $limit))->toAssocArray("cldbid");
  }
112274
public function getObjectsWithCollections($limit, $offset)
    {
        $contentIdsQuery = $this->connection->createQueryBuilder();
        $contentIdsQuery
            ->select("DISTINCT contentobject_id AS id")
            ->from($this->connection->quoteIdentifier('ezinfocollection'));

        $statement = $contentIdsQuery->execute();

        $contents = [];
        foreach ($statement->fetchAll() as $content) {
            $contents[] = (int)$content['id'];
        }

        if (empty($contents)) {
            return [];
        }

        $query = $this->connection->createQueryBuilder();
        $query
            ->select(
                "eco.id AS content_id",
                "ecot.main_node_id"
            )
            ->from($this->connection->quoteIdentifier('ezcontentobject'), 'eco')
            ->leftJoin(
                'eco',
                $this->connection->quoteIdentifier('ezcontentobject_tree'),
                'ecot',
                $query->expr()->eq(
                    $this->connection->quoteIdentifier('eco.id'),
                    $this->connection->quoteIdentifier('ecot.contentobject_id')
                )
            )
            ->innerJoin(
                'eco',
                $this->connection->quoteIdentifier('ezcontentclass'),
                'ecc',
                $query->expr()->eq(
                    $this->connection->quoteIdentifier('eco.contentclass_id'),
                    $this->connection->quoteIdentifier('ecc.id')
                )
            )
            ->where(
                $query->expr()->eq('ecc.version', 0)
            )
            ->andWhere($query->expr()->in('eco.id', $contents))
            ->groupBy([
                $this->connection->quoteIdentifier('ecot.main_node_id'),
                $this->connection->quoteIdentifier('content_id'),
            ])
            ->setFirstResult($offset)
            ->setMaxResults($limit);

        $statement = $query->execute();

        return $statement->fetchAll(PDO::FETCH_ASSOC);
    }
304552
public function getList($key, $offset = 0, $limit = - 1)
    {
        return $this->driver->lRange($key, $offset, $limit);
    }
1217853
public function all($offset = 0, $limit = 15)
    {
        $results = array_slice($this->memory, $offset, $limit);

        foreach ($results as $key => $value) {
            $results[$key] = json_decode($value[self::SUMMARY_KEY]);
        }

        return $results;
    }
1159925
public function getDeniedFriendships($limit = null, $offset = 0): array
    {
        return $this->findFriendshipsByStatus(Status::DENIED, $limit, $offset);
    }
790304
protected function fetch($limit = null, $offset = null)
    {
        if (is_int($limit)) {
            $this->statement->limit($limit, $offset);
        }

        $statement = $this->statement->execute();

        if ($this->model instanceof Models) {
            $statement->setFetchMode(\PDO::FETCH_INTO, $this->model);
        } else {
            $statement->setFetchMode(\PDO::FETCH_CLASS|\PDO::FETCH_PROPS_LATE, $this->model);
        }

        return $statement;
    }
950366
private function normalizeOffsetAndLimit($offset = 0, $limit = 25)
    {
        $offset = (int) $offset;
        $limit = (int) $limit;

        $offset = max($offset, 0);
        $limit = min(max($limit, 0), 25);

        return [$offset, $limit];
    }
1284811
public function prepareLimit($limit, $offset = null)
    {
        if ($offset) {
            $this->setLimit = ' LIMIT ' . $limit . ', ' . $offset . '';
        } else {
            $this->setLimit = ' LIMIT ' . $limit . '';
        }

        return $this;
    }
1287118
public function limit($limit, $offset = null)
    {
        if ($offset) {
            $this->getLimit()->setParams(array($limit, $offset));
        } else {
            $this->getLimit()->setParams(array($limit));
        }

        return $this;
    }
802679
public static function load( $fileName, $offset = NULL, $limit = NULL )
	{
		$file	= new FS_File_Reader( $fileName );
		$lines	= $file->readArray();
		if( $offset !== NULL && $limit !== NULL && (int) $limit !==  0 )
			$lines	= array_slice( $lines, abs( (int) $offset ), (int) $limit );
		else if( $offset !== NULL && (int) $offset !== 0 )
			$lines	= array_slice( $lines, (int) $offset );
		return $lines;
	}
301480
public function listCampaigns($limit = null, $offset = null)
    {
        $data = array();
        if (!empty($limit)) {
            $data['limit'] = $limit;
        }
        if (!empty($offset)) {
            $data['offset'] = $offset;
        }
        $requestResult = $this->sendRequest('campaigns', 'GET', $data);

        return $this->handleResult($requestResult);
    }