src/EntityQueryBuilder.php
public function from($from = null, $alias = null, $indexBy = null)
    {
        if ($from === null) {
            $from = $this->getEntityClassName();

            if ($alias === null) {
                $alias = $this->getEntityAlias();
            }
        }

        parent::from($from, $alias, $indexBy = null);

        return $this;
    }
public function from($from = null, $alias = null, $indexBy = null)
    {
        if ($from === null) {
            $from = $this->getEntityClassName();

            if ($alias === null) {
                $alias = $this->getEntityAlias();
            }
        }

        parent::from($from, $alias, $indexBy = null);

        return $this;
    }
Creates and adds a query root corresponding to the entity identified by the given alias,
forming a cartesian product with any existing query roots.

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

@param string $from    The class name.
@param string $alias   The alias of the class.
@param string $indexBy The index for the from.

@return $this This QueryBuilder instance.
@throws \ReflectionException