Esempio n. 1
0
 /**
  * Apply without render
  */
 function apply_filters()
 {
     $this->_apply();
     if ($this->pagination_limit * $this->pagination_start > $this->count + $this->pagination_limit) {
         throw new collection_filter_exception('Invalid range ' . $this->pagination_limit * $this->pagination_start . ' > ' . $this->count);
     }
     // real page 0=1, 2...
     $real_page = $this->pagination_start > 1 ? $this->pagination_start - 1 : 0;
     $this->collection->set_limit($this->pagination_limit, $real_page * $this->pagination_limit);
     $this->collection->load();
     // Run callback
     if ($this->on_apply_callback instanceof Closure) {
         call_user_func($this->on_apply_callback, $this->collection);
         $this->on_apply_callback = null;
     }
     // generate_pagination
     $this->pagination = $this->paginate($this->base_url, $this->count, $this->pagination_limit, $this->pagination_start);
     return $this;
 }