public function page($pageSize = 10, $currentPage = 0)
    {
        if ($pageSize === static::$pageAll) {
            return $this;
        }
        /* normalize $currentPage and $currentPage */
        if (!is_numeric($currentPage) || $currentPage < 0) {
            $currentPage = 0;
        }
        $currentPage = (int) $currentPage;
        if (!is_numeric($pageSize) || $pageSize < 1) {
            $pageSize = static::$defaultPageSize;
        }
        $pageSize = (int) $pageSize;
        return $this->limit($pageSize)->offset($pageSize * $currentPage);
    }
public function page($pageSize = 10, $currentPage = 0)
    {
        if ($pageSize === static::$pageAll) {
            return $this;
        }
        /* normalize $currentPage and $currentPage */
        if (!is_numeric($currentPage) || $currentPage < 0) {
            $currentPage = 0;
        }
        $currentPage = (int) $currentPage;
        if (!is_numeric($pageSize) || $pageSize < 1) {
            $pageSize = static::$defaultPageSize;
        }
        $pageSize = (int) $pageSize;
        return $this->limit($pageSize)->offset($pageSize * $currentPage);
    }
public function page ( $ pageSize = 10 , $ currentPage = 0 ) { if ( $ pageSize === static :: $ pageAll ) { return $ this ; } /* normalize $currentPage and $currentPage */ if ( ! is_numeric ( $ currentPage ) || $ currentPage < 0 ) { $ currentPage = 0 ; } $ currentPage = ( int ) $ currentPage ; if ( ! is_numeric ( $ pageSize ) || $ pageSize < 1 ) { $ pageSize = static :: $ defaultPageSize ; } $ pageSize = ( int ) $ pageSize ; return $ this -> limit ( $ pageSize ) -> offset ( $ pageSize * $ currentPage ) ; }
Specify page condition.
@param string|int $pageSize It will return all models if it is 'all',
or it will be regarded as sum of models.
@param int $currentPage The current page number if it is integer begun with 0.
@return $this
Specify page condition .