Esempio n. 1
0
 /**
  * Apply filters (internal)
  */
 protected function _apply()
 {
     if ($this->_with_clear) {
         $this->collection->clear(1);
     }
     // prepend config
     // make shure no "limit sql" in it!
     $config = $this->config;
     // where sql prepare
     /*
     if (isset($config['where_sql'])) {
         $where_sql_ = $this->collection->cfg('where_sql');
         if (!empty($where_sql_)) {
             $config['where_sql'] = $where_sql_ . ' AND ' . $config['where_sql'];
         }
     }
     */
     // map filter config to collection
     if (!$config->is_empty()) {
         foreach ($config as $k => $v) {
             $this->collection->config->set($k, $v);
         }
     }
     // apply user filters
     $this->collection_filters();
     $this->count = $this->_no_count ? $this->count : $this->collection->count_sql();
     $this->_no_count = false;
     core::dprint('[FILTER] Apply for ' . $this->collection->get_name() . ' x ' . $this->count);
 }