Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/12/2013, 10:26
pmeninsaxmus16
 
Fecha de Ingreso: noviembre-2013
Mensajes: 83
Antigüedad: 10 años, 5 meses
Puntos: 0
Pregunta Metodo _toString() Doctrine, Service

Hola a todos tengo este error:
The Response content must be a string or object implementing __toString(), "object" given.

porque estoy haciendo una consulta en un service que es asi:

+++++++++++++++++++++++++++++++++ service
function __construct($entityManager, $container)
{
$this->em = $entityManager;
$this->container = $container;
}
function generarIdCarStudent($id)
{
$sql2="SELECT a.firstname FROM ABCIsystemBundle:AbcMembers a where a.id='$id'";
$query2= $this->em->createQuery($sql2);
$query2->getResult();
return $query2;
}
+++++++++++++++++++++++++++++++++

y en e controller lo llamo asi

================================== controller
{

$prueba= $this->get('applicantAdmission');
$msg=$prueba->generarIdCarStudent($id);
return new Response($msg);
}
=======================================

alguna ayuda