示例#1
0
 /**
  * Constructs a comparison expression with the comparison
  * operator $op and two operands, $left and $right,
  * which are FQLExpressions themselves.
  *
  * @param $op    comparison operator (<, >, =, ==, <=,
  *               >=, !=, <>, ^=, !^)
  * @param $left  FQLExpression representing left operand
  * @param $right FQLExpression representing right operand
  */
 public function __construct($op, $left, $right)
 {
     $this->op = $op;
     // canonicalize operators
     switch ($this->op) {
         case '=':
             $this->op = '==';
             break;
         case '<>':
             $this->op = '!=';
             break;
     }
     parent::__construct($left, $right);
 }
示例#2
0
 /**
  * Constructs the arithmetic expression with the arithmetic
  * operator $op and two operands, $left and $right, which
  * are FQLExpressions themselves.
  *
  * @param  $op     arithmetic op (+, -, *, /)
  * @param  $left   FQLExpression representing left operand
  * @param  $right  FQLExpression representing right operand
  */
 public function __construct($op, $left, $right)
 {
     $this->op = $op;
     parent::__construct($left, $right);
 }