src/Services/DocumentSearch.php
private function set_page($intPage = 1)
    {
        if (!isset($this->arrPayload['count'])) {
            throw new DocumentSearchMissingCount('\DocumentSearch::setPerPage() is required before \DocumentSearch::setPage()');
        }

        // get the page
        if (isset($this->arrSearch['page'])) {
            $intPage = $this->arrSearch['page'];
        }

        // set the starting point
        $this->arrPayload['start'] = $this->arrPayload['count'] * ($intPage - 1);

        return $this;
    }
private function set_page($intPage = 1)
    {
        if (!isset($this->arrPayload['count'])) {
            throw new DocumentSearchMissingCount('\DocumentSearch::setPerPage() is required before \DocumentSearch::setPage()');
        }

        // get the page
        if (isset($this->arrSearch['page'])) {
            $intPage = $this->arrSearch['page'];
        }

        // set the starting point
        $this->arrPayload['start'] = $this->arrPayload['count'] * ($intPage - 1);

        return $this;
    }
Set page number for calculating the correct starting offset

@param integer $intPage Page number
@return $this
@throws DocumentSearchMissingCount