/** * очистить * * clear all: * clears position */ function clear($all = false) { $this->_ids_cache = array(); $this->items = array(); $this->config->clear('no_preload'); $this->config->clear('load_only_id'); if ($all) { $this->set_working_fields(); $this->config->clear('order_sql'); $this->config->clear('where_sql'); $this->config->clear('limit_sql'); $this->config->clear('join_where_sql'); $this->config->clear('join_sql'); // restore initial order $this->set_order($this->_order_sql); } return $this; }