addSchema($schema[0], $schema[1]); } foreach($config['cols'] as $col) { $this->addColumn($col); } // apply dynamic paramters $this->dynamicParameters = new SearchConfigParameters($this); $config = $this->dynamicParameters->updateConfig($config); // configure search from configuration if(!empty($config['filter'])) foreach($config['filter'] as $filter) { $this->addFilter($filter[0], $filter[2], $filter[1], $filter[3]); } if(!empty($config['sort'])) foreach($config['sort'] as $sort) { $this->addSort($sort[0], $sort[1]); } if(!empty($config['limit'])) { $this->setLimit($config['limit']); } if(!empty($config['offset'])) { $this->setLimit($config['offset']); } $this->config = $config; } /** * Access the dynamic paramters of this search * * Note: This call returns a clone of the parameters as they were initialized * * @return SearchConfigParameters */ public function getDynamicParameters() { return clone $this->dynamicParameters; } /** * @return array the current config */ public function getConf() { return $this->config; } }