Query::__construct PHP Метод

__construct() публичный Метод

public __construct ( $id = false, $table = null, $ds = null )
    public function __construct($id = false, $table = null, $ds = null)
    {
        if (!$this->operators) {
            $this->operators = array("=" => __('is'), "!" => __('is not'), "o" => __('open'), "c" => __('closed'), "!*" => __('none'), "*" => __('all'), ">=" => '>=', "<=" => '<=', "<t+" => __('in less than'), ">t+" => __('in more than'), "t+" => __('in'), "t" => __('today'), "w" => __('this week'), ">t-" => __('less than days ago'), "<t-" => __('more than days ago'), "t-" => __('days ago'), "~" => __('contains'), "!~" => __("doesn't contain"));
        }
        if (!$this->operators_by_filter_type) {
            $this->operators_by_filter_type = array('list' => array("=", "!"), 'list_status' => array("o", "=", "!", "c", "*"), 'list_optional' => array("=", "!", "!*", "*"), 'list_subprojects' => array("*", "!*", "="), 'date' => array("<t+", ">t+", "t+", "t", "w", ">t-", "<t-", "t-"), 'date_past' => array(">t-", "<t-", "t-", "t", "w"), 'string' => array("=", "~", "!", "!~"), 'text' => array("~", "!~"), 'integer' => array("=", ">=", "<=", "!*", "*"));
        }
        if (!$this->default_show_filters) {
            $this->default_show_filters = array('status_id' => array('operator' => "o", 'values' => array("")));
        }
        parent::__construct($id, $table, $ds);
    }

Usage Example

Пример #1
0
 /**
  * Optionally sets the table name and initializes the internal class
  * properties.
  *
  * @param string $table  The name of the table
  */
 public function __construct($table = null)
 {
     $this->where = new \Bistro\Data\Query\Where();
     $this->order_by = new \Bistro\Data\Query\Order();
     $this->limit = new \Bistro\Data\Query\Limit();
     parent::__construct($table);
 }
All Usage Examples Of Query::__construct