예제 #1
0
 function toDialectString(IDialect $dialect)
 {
     $compiledSlices = array();
     $compiledSlices[] = '(';
     $compiledSlices[] = $this->subject->toDialectString($dialect);
     $compiledSlices[] = ')';
     $compiledSlices[] = $this->operator->toDialectString($dialect);
     $compiledSlices[] = '(';
     $compiledSlices[] = $this->value->toDialectString($dialect);
     $compiledSlices[] = ')';
     $compiledString = join(' ', $compiledSlices);
     return $compiledString;
 }
예제 #2
0
 /**
  * Creates an instance of binary expression node, representing the construction: subject / value
  *
  * @param mixed $subject logical subject
  * @param mixed $value value to divide the subject
  *
  * SQL example:
  * @code
  * // "cost" / 2
  * Expression::div("cost", 2);
  * @endcode
  * @return BinaryExpression
  */
 static function div($subject, $value)
 {
     return new BinaryExpression($subject, BinaryLogicalOperator::divide(), $value);
 }