src/CentralApps/Pagination/PdoTrait.php
protected function checkForMainOffsetOrLimit($sql)
    {
        if ("" !== $this->stripQueryToUnnestedKeyword($sql, $unnested_keyword = 'LIMIT')) {
            throw new \LogicException("Query cannot contain an unnested LIMIT when trying to paginate");
        }

        if ("" !== $this->stripQueryToUnnestedKeyword($sql, $unnested_keyword = 'OFFSET')) {
            throw new \LogicException("Query cannot contain an unnested OFFSET when trying to paginate");
        }

        return true;
    }
protected function checkForMainOffsetOrLimit($sql)
    {
        if ("" !== $this->stripQueryToUnnestedKeyword($sql, $unnested_keyword = 'LIMIT')) {
            throw new \LogicException("Query cannot contain an unnested LIMIT when trying to paginate");
        }

        if ("" !== $this->stripQueryToUnnestedKeyword($sql, $unnested_keyword = 'OFFSET')) {
            throw new \LogicException("Query cannot contain an unnested OFFSET when trying to paginate");
        }

        return true;
    }
protected function checkForMainOffsetOrLimit ( $ sql ) { if ( "" !== $ this -> stripQueryToUnnestedKeyword ( $ sql , $ unnested_keyword = 'LIMIT' ) ) { throw new \ LogicException ( "Query cannot contain an unnested LIMIT when trying to paginate" ) ; } if ( "" !== $ this -> stripQueryToUnnestedKeyword ( $ sql , $ unnested_keyword = 'OFFSET' ) ) { throw new \ LogicException ( "Query cannot contain an unnested OFFSET when trying to paginate" ) ; } return true ; }
Ensure that the query can be paginated
@param string $sql the query
@return bool
@throws \LogicException if either LIMIT or OFFSET is found
Ensure that the query can be paginated