Author: Elliot Levin (elliotlevin@hotmail.com)
Inheritance: extends VariadicLanguageConstructExpression
 protected function visitIsset(O\IssetExpression $expression)
 {
     $binaryOperations = [];
     foreach ($expression->getValues() as $value) {
         $binaryOperations[] = $this->compileInContext($value) . ' IS NOT NULL';
     }
     $this->sql .= '(' . implode(' AND ', $binaryOperations) . ')';
 }
Beispiel #2
0
 public function visitIsset(O\IssetExpression $expression)
 {
     $this->walkAll($expression->getValues());
     $this->analysis[$expression] = $this->typeSystem->getNativeType(INativeType::TYPE_BOOL);
 }
 protected final function visitOffsetUnset(O\Expression $expression)
 {
     $operationId = $this->getId('offset-unset');
     $indexId = $this->getId('unset-index');
     if ($expression instanceof O\MethodCallExpression) {
         $this->interpretation->interpretOffsetUnset($operationId, $indexId, $this->getArgumentValueAt(0, $expression));
         $this->interpretSourceAsScope($expression);
         return;
     } elseif ($expression instanceof O\UnsetExpression) {
         $unsetArguments = $expression->getValues();
         if (count($unsetArguments) === 1 && $unsetArguments[0] instanceof O\IndexExpression) {
             $this->interpretation->interpretOffsetUnset($operationId, $indexId, $this->getValue($unsetArguments[0]->getIndex()));
             $this->interpretSourceAsScope($unsetArguments[0]);
             return;
         }
     }
     throw new PinqException('Cannot interpret offset unset operation: invalid expression type, expecting %s, %s given', O\MethodCallExpression::getType() . ' or ' . O\IssetExpression::getType() . ' with a single parameter index', $expression->getType());
 }