Index: trunk/core/kernel/utility/filters.php =================================================================== diff -u -N --- trunk/core/kernel/utility/filters.php (revision 8067) +++ trunk/core/kernel/utility/filters.php (revision 0) @@ -1,118 +0,0 @@ -setType($type); - } - - /** - * Enter description here... - * - * @param int $new_type - */ - function setType($new_type) - { - $this->type = $new_type; - } - - /** - * Adds new or replaces old filter with same name - * - * @param string $name - * @param mixed $clause kMultipleFilter object or where clause ifself - * @access public - */ - function addFilter($name, $clause) - { - if( is_object($clause) && $clause->hasFilters() ) - { - $this->filters[$name] = $clause->getSQL(); - } - elseif( !is_object($clause) && strlen($clause) ) - { - $this->filters[$name] = $clause; - } - } - - /** - * Returns filter by name - * - * @param string $name - * @return string - */ - function getFilter($name) - { - return isset($this->filters[$name]) ? $this->filters[$name] : false; - } - - /** - * Removes specified filter from filters list - * - * @param string $name - * @access public - */ - function removeFilter($name) - { - unset($this->filters[$name]); - } - - /** - * Remove all added filters - * - * @access public - */ - function clearFilters() - { - $this->filters = Array(); - } - - /** - * Build where clause based on added filters and multiple filter type - * - * @return string - * @access public - */ - function getSQL() - { - $filter_count = count($this->filters); - if(!$filter_count) return ''; - - return '('.implode(') '.$this->type.' (',$this->filters).')'; - } - - /** - * Allows to check if some filters are added to multiple filter - * - * @return bool - * @access public - */ - function hasFilters() - { - return $this->filters ? true : false; - } - } -?> \ No newline at end of file