/**
  * @param VisitNodeEvent $event node event to visit
  *
  * @return VisitNodeEvent
  */
 public function onVisitNode(VisitNodeEvent $event)
 {
     $node = $event->getNode();
     if ($node instanceof AbstractScalarOperatorNode && $this->isExtrefField($node->getField(), $event->getContext())) {
         $event->setNode($this->processScalarNode($node));
     } elseif ($node instanceof AbstractArrayOperatorNode && $this->isExtrefField($node->getField(), $event->getContext())) {
         $event->setNode($this->processArrayNode($node));
     }
     return $event;
 }
Пример #2
0
 /**
  * @param VisitNodeEvent $event node event to visit
  *
  * @return VisitNodeEvent
  */
 public function onVisitNode(VisitNodeEvent $event)
 {
     $node = $event->getNode();
     if (!$node instanceof AbstractComparisonOperatorNode) {
         return $event;
     }
     $fieldName = $this->getDocumentFieldName($node->getField(), $event->getContext());
     if ($fieldName === false) {
         return $event;
     }
     $copy = clone $node;
     $copy->setField(strtr($fieldName, ['.0.' => '.']));
     $event->setNode($copy);
     return $event;
 }