Exemple #1
0
 /**
  * Constructor.
  *
  * Argument $config may contain:
  *  pair: array of replace pairs in form old => new.
  *
  * @param array $config Configuration.
  */
 public function __construct($config)
 {
     parent::__construct($config);
     if (isset($config['pair']) && is_array($config['pair'])) {
         $this->addPair($config['pair']);
     }
 }
Exemple #2
0
 /**
  * Constructor.
  *
  * Argument $config may contain
  *  fields:   Set of fields to use, see setFields().
  *  ops:      Operators to enable, see activateOperators().
  *
  * @param array $config Configuration.
  */
 public function __construct($config)
 {
     parent::__construct($config);
     if (isset($config['fields']) && is_array($config['fields'])) {
         $this->addFields($config['fields']);
     }
     if (isset($config['ops']) && (!isset($this->ops) || !is_array($this->ops))) {
         $this->activateOperators($config['ops']);
     } else {
         $this->activateOperators($this->availableOperators());
     }
 }
Exemple #3
0
 /**
  * Constructor.
  *
  * Argument $config may contain
  *  fields:   Set of fields to use, see setFields().
  *  ops:      Operators to enable, see activateOperators().
  *
  * @param array $config Configuration.
  */
 public function __construct($config)
 {
     parent::__construct($config);
     if (isset($config['fields']) && (!isset($this->_fields) || !is_array($this->_fields))) {
         $this->addFields($config['fields']);
     }
     if (isset($config['ops']) && (!isset($this->_ops) || !is_array($this->_ops))) {
         $this->activateOperators($config['ops']);
     } else {
         $this->activateOperators(array('eq', 'ne', 'lt', 'le', 'gt', 'ge', 'search', 'like', 'likefirst', 'null', 'notnull'));
     }
     if (isset($config['default']) && $config['default'] == true || count($this->_fields) <= 0) {
         $this->default = true;
     }
 }