src/Graviton/DocumentBundle/Listener/RqlSearchNodeListener.php
public function onVisitNode(VisitNodeEvent $event)
    {
        // any search?
        if (!$event->getNode() instanceof SearchNode || $event->getNode()->isVisited()) {
            return $event;
        }

        $this->node = $event->getNode();
        $this->builder = $event->getBuilder();
        $this->expr = $event->isExpr();
        $this->className = $event->getClassName();

        // which mode?
        if ($this->getSearchMode() === self::SEARCHMODE_SOLR) {
            $this->handleSearchSolr();
        } else {
            $this->handleSearchMongo();
        }

        $event->setBuilder($this->builder);
        $event->setNode($this->node);
        $event->setExprNode($this->exprNode);

        return $event;
    }
public function onVisitNode(VisitNodeEvent $event)
    {
        // any search?
        if (!$event->getNode() instanceof SearchNode || $event->getNode()->isVisited()) {
            return $event;
        }

        $this->node = $event->getNode();
        $this->builder = $event->getBuilder();
        $this->expr = $event->isExpr();
        $this->className = $event->getClassName();

        // which mode?
        if ($this->getSearchMode() === self::SEARCHMODE_SOLR) {
            $this->handleSearchSolr();
        } else {
            $this->handleSearchMongo();
        }

        $event->setBuilder($this->builder);
        $event->setNode($this->node);
        $event->setExprNode($this->exprNode);

        return $event;
    }
public function onVisitNode ( VisitNodeEvent $ event ) { // any search? if ( ! $ event -> getNode ( ) instanceof SearchNode || $ event -> getNode ( ) -> isVisited ( ) ) { return $ event ; } $ this -> node = $ event -> getNode ( ) ; $ this -> builder = $ event -> getBuilder ( ) ; $ this -> expr = $ event -> isExpr ( ) ; $ this -> className = $ event -> getClassName ( ) ; // which mode? if ( $ this -> getSearchMode ( ) === self :: SEARCHMODE_SOLR ) { $ this -> handleSearchSolr ( ) ; } else { $ this -> handleSearchMongo ( ) ; } $ event -> setBuilder ( $ this -> builder ) ; $ event -> setNode ( $ this -> node ) ; $ event -> setExprNode ( $ this -> exprNode ) ; return $ event ; }
gets called during the visit of a normal search node

@param VisitNodeEvent $event node event to visit

@return VisitNodeEvent event object
gets called during the visit of a normal search node