lib/Doctrine/ORM/QueryBuilder.php
public function getRootAliases()
    {
        $aliases = [];

        foreach ($this->dqlParts['from'] as &$fromClause) {
            if (is_string($fromClause)) {
                $spacePos = strrpos($fromClause, ' ');
                $from     = substr($fromClause, 0, $spacePos);
                $alias    = substr($fromClause, $spacePos + 1);

                $fromClause = new Query\Expr\From($from, $alias);
            }

            $aliases[] = $fromClause->getAlias();
        }

        return $aliases;
    }
public function getRootAliases()
    {
        $aliases = [];

        foreach ($this->dqlParts['from'] as &$fromClause) {
            if (is_string($fromClause)) {
                $spacePos = strrpos($fromClause, ' ');
                $from     = substr($fromClause, 0, $spacePos);
                $alias    = substr($fromClause, $spacePos + 1);

                $fromClause = new Query\Expr\From($from, $alias);
            }

            $aliases[] = $fromClause->getAlias();
        }

        return $aliases;
    }
public function getRootAliases ( ) { $ aliases = [ ] ; foreach ( $ this -> dqlParts [ 'from' ] as & $ fromClause ) { if ( is_string ( $ fromClause ) ) { $ spacePos = strrpos ( $ fromClause , ' ' ) ; $ from = substr ( $ fromClause , 0 , $ spacePos ) ; $ alias = substr ( $ fromClause , $ spacePos + 1 ) ; $ fromClause = new Query \ Expr \ From ( $ from , $ alias ) ; } $ aliases [ ] = $ fromClause -> getAlias ( ) ; } return $ aliases ; }
Gets the root aliases of the query. This is the entity aliases involved
in the construction of the query.

<code>
$qb = $em->createQueryBuilder()
->select('u')
->from('User', 'u');

$qb->getRootAliases(); // array('u')
</code>

@return string[]
Gets the root aliases of the query . This is the entity aliases involved in the construction of the query .