Example #1
0
 /**
  * Parse the given string as a relation query.
  * 
  * @param string $string
  */
 public function __construct($string)
 {
     parent::__construct($string);
     list($relation, $value) = explode(Factory::syntax('symbols', 'relation', ':'), $string);
     $this->relation = $relation;
     $this->value = $value;
 }
Example #2
0
 /**
  * Parse the given string as an range query.
  * 
  * @param string $string
  */
 public function __construct($string)
 {
     parent::__construct($string);
     $values = explode(Factory::syntax('symbols', 'delim', '|'), $string);
     foreach ($values as $value) {
         $this->values[] = OperatorQuery::make($value);
     }
 }
Example #3
0
 /**
  * Parse the given string as an operator query.
  * 
  * @param string $string
  */
 public function __construct($string)
 {
     parent::__construct($string);
     $this->operator = Factory::syntax('symbols', 'equals', '=');
     $this->value = $string;
     $operators = [Factory::syntax('symbols', 'equals', '='), Factory::syntax('symbols', 'bigger', ']'), Factory::syntax('symbols', 'smaller', '['), Factory::syntax('symbols', 'like', '~'), Factory::syntax('symbols', 'not', '!')];
     if (in_array($string[0], $operators)) {
         $this->operator = $string[0];
         $this->value = substr($string, 1);
     }
     $this->method = $this->getMethodFromOperator($this->operator);
 }