Пример #1
0
 /**
  * @param \Xiag\Rql\Parser\Node\Query\AbstractLogicalOperatorNode $node
  *
  * @return mixed
  * @throws \AndreasGlaser\DoctrineRql\Visitor\VisitorException
  * @author Andreas Glaser
  */
 protected function visitLogic(AbstractLogicalOperatorNode $node)
 {
     if (!($class = ArrayHelper::get($this->logicMap, get_class($node)))) {
         throw new VisitorException(sprintf('Unsupported node "%s"', get_class($node)));
     }
     $expr = new $class();
     foreach ($node->getQueries() as $query) {
         $expr->add($this->walkNodes($query));
     }
     // Notx workaround
     if ($node instanceof Node\Query\LogicalOperator\NotNode) {
         $expr = new Expr\Func('NOT', $expr->getParts());
     }
     return $expr;
 }