I\'m trying to custom select use this code
$result = $qb->select(\'partial user.{id,name}\')
->from(\'User\', \'user\')
Using the DQL "partial" keyword is not enough to get a partial entity as a result.
The DQL hint HINT_FORCE_PARTIAL_LOAD must be used as well.
$query = $qb->select('partial user.{id,name}')
->from('User', 'user')
->leftJoin('user.group', 'group')
->getQuery()
;
$query->setHint(Doctrine\ORM\Query::HINT_FORCE_PARTIAL_LOAD, 1);
$results = $query->getResult();