Doctrine\ORM\Query\Parser::getAST PHP Method

getAST() public method

Parse and build AST for the given Query.
public getAST ( ) : Doctrine\ORM\Query\AST\SelectStatement
return Doctrine\ORM\Query\AST\SelectStatement | \Doctrine\ORM\Query\AST\UpdateStatement | \Doctrine\ORM\Query\AST\DeleteStatement
    public function getAST()
    {
        // Parse & build AST
        $AST = $this->QueryLanguage();

        // Process any deferred validations of some nodes in the AST.
        // This also allows post-processing of the AST for modification purposes.
        $this->_processDeferredIdentificationVariables();

        if ($this->_deferredPartialObjectExpressions) {
            $this->_processDeferredPartialObjectExpressions();
        }

        if ($this->_deferredPathExpressions) {
            $this->_processDeferredPathExpressions($AST);
        }

        if ($this->_deferredResultVariables) {
            $this->_processDeferredResultVariables();
        }

        return $AST;
    }

Usage Example

Esempio n. 1
0
 /**
  * Returns the corresponding AST for this DQL query.
  *
  * @return \Doctrine\ORM\Query\AST\SelectStatement |
  *         \Doctrine\ORM\Query\AST\UpdateStatement |
  *         \Doctrine\ORM\Query\AST\DeleteStatement
  */
 public function getAST()
 {
     $parser = new Parser($this);
     return $parser->getAST();
 }
Parser