i have a repository
class TurnoRepository extends EntityRepository
{
public function findTurnoActivo()
{
$q = $this
->createQu
Symfony2 code is namespaced so you have to add the correct namespace for the class NoResultException
, try using:
catch (\Doctrine\ORM\NoResultException $e)
Note the backslash in front of the Doctrine namespace or import the NoResultException
class by using use
.
You can use $q->getOneOrNullResult();
if you don't want to catch NoResultException
in the controller.