src/Charcoal/Source/AbstractSource.php
public function setPagination($param, $limit = null)
    {
        if ($param instanceof PaginationInterface) {
            $pager = $param;
        } elseif (is_numeric($param)) {
            $pager = $this->createPagination();
            $pager->setPage($param);
            $pager->setNumPerPage($limit);
        } elseif (is_array($param)) {
            $pager = $this->createPagination();
            $pager->setData($param);
        } else {
            throw new InvalidArgumentException(
                'Can not set pagination, invalid argument.'
            );
        }

        $this->pagination = $pager;

        return $this;
    }
public function setPagination($param, $limit = null)
    {
        if ($param instanceof PaginationInterface) {
            $pager = $param;
        } elseif (is_numeric($param)) {
            $pager = $this->createPagination();
            $pager->setPage($param);
            $pager->setNumPerPage($limit);
        } elseif (is_array($param)) {
            $pager = $this->createPagination();
            $pager->setData($param);
        } else {
            throw new InvalidArgumentException(
                'Can not set pagination, invalid argument.'
            );
        }

        $this->pagination = $pager;

        return $this;
    }
public function setPagination ( $ param , $ limit = null ) { if ( $ param instanceof PaginationInterface ) { $ pager = $ param ; } elseif ( is_numeric ( $ param ) ) { $ pager = $ this -> createPagination ( ) ; $ pager -> setPage ( $ param ) ; $ pager -> setNumPerPage ( $ limit ) ; } elseif ( is_array ( $ param ) ) { $ pager = $ this -> createPagination ( ) ; $ pager -> setData ( $ param ) ; } else { throw new InvalidArgumentException ( 'Can not set pagination, invalid argument.' ) ; } $ this -> pagination = $ pager ; return $ this ; }
Set query pagination.

@param  mixed        $param The pagination object or array.
@param  integer|null $limit The number of results to fetch if $param is a page number.
@throws InvalidArgumentException If the $param argument is invalid.
@return self
Set query pagination .