Exemplo n.º 1
0
 /**
  * Parse a DynamicOperand into SQL and parameter arrays.
  *
  * @param Qom\ComparisonInterface $comparison
  * @param Qom\SourceInterface $source The source
  * @param array &$sql The query parts
  * @return void
  */
 protected function parseDynamicOperand(Qom\ComparisonInterface $comparison, Qom\SourceInterface $source, array &$sql)
 {
     $operator = $this->resolveOperator($comparison->getOperator());
     $operand = $comparison->getOperand1();
     $constraintSQL = $this->parseOperand($operand, $source, $sql) . ' ' . $operator . ' ';
     $parameterIdentifier = $this->normalizeParameterIdentifier($comparison->getParameterIdentifier());
     if ($operator === 'IN') {
         $parameterIdentifier = '(' . $parameterIdentifier . ')';
     }
     $constraintSQL .= $parameterIdentifier;
     $sql['where'][] = $constraintSQL;
 }