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

        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);
            }

            $entities[] = $fromClause->getFrom();
        }

        return $entities;
    }
public function getRootEntities()
    {
        $entities = [];

        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);
            }

            $entities[] = $fromClause->getFrom();
        }

        return $entities;
    }
public function getRootEntities ( ) { $ entities = [ ] ; 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 ) ; } $ entities [ ] = $ fromClause -> getFrom ( ) ; } return $ entities ; }
Gets the root entities 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->getRootEntities(); // array('User')
</code>

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