krushn / Opencart-easy-sql

Opencart query builder for easy sql query writing, with shorted sql statement
http://krushn.github.io/Opencart-easy-sql/
5 stars 6 forks source link

Call to undefined method DB::_limit() #2

Open victorhramos opened 8 years ago

victorhramos commented 8 years ago

Trying to use limit method $this->db->limit(1);

Fatal error: Uncaught Error: Call to undefined method DB::_limit() in C:\laragon\www\codemarket\system\library\db.php:1773 Stack trace: #0

C:\laragon\www\codemarket\system\library\db.php(889): DB->_compile_select() #1

victorhramos commented 8 years ago

Wrote simply method only to avoid that error, need some more tests and implementation:

public function _limit($sql, $limit, $offset = 1)
    {
        if (!is_numeric($offset)) {
            $offset = 1;
        }

        $sql .= " LIMIT {$limit}, {$offset}";

        return $sql;
    }