Example #1
0
 public function delete()
 {
     $query = new DingoQuery('delete');
     $query->table = $this;
     if (func_num_args() == 3) {
         $args = func_get_args();
         return $query->where($args[0], $args[1], $args[2])->execute();
     } else {
         return $query;
     }
 }
Example #2
0
 public function paginate($page = 1, $limit = 10, &$p = FALSE)
 {
     // Get row count
     $q = new DingoQuery('count');
     $q->table = $this->table;
     $q->where_list = $this->where_list;
     $q->order_list = $this->order_list;
     $q->_join = $this->_join;
     $count = $q->execute();
     // Paginate
     load::library('pagination');
     $p = new pagination($count, $page, $limit);
     $this->offset($p->min);
     $this->limit($limit);
     return $this;
 }