Inglês It is possible to return an instance of class in Doctrine2?
PDO is very simple
$query->setFetchMode(PDO::FETCH_CLASS, 'model\vo\envio_vo');
Inglês It is possible to return an instance of class in Doctrine2?
PDO is very simple
$query->setFetchMode(PDO::FETCH_CLASS, 'model\vo\envio_vo');
This might help you. This will give you ArrayCollection of User objects
$qb = $this->em->createQueryBuilder();
$qb->select('u');
$qb->from('Entity\User', 'u');
$qb->innerJoin('Entity\UserMeta', 'um', 'WITH', 'um.user = u.id');
$qb->where('u.id = :UserId')->setParameter(':UserId', $userId);
return $qb->getQuery()->getResult();
if you want ArrayCollection of User columns, you can change code like
$qb->select('u.*');