我不希望屏幕上出现这种错误:
[语义错误]第0行,第66行附近' ewdd =:para':错误:类 AppBundle \ Entity \ Ksiazka没有名为ewdd的字段或关联
如何在我的控制器中使用KNP Paginator捕获Doctrine \ ORM \ Query \ QueryException?
$query = $em->createQuery(
'SELECT a
FROM AppBundle:Book a
WHERE a.'.$findby.' = :param'
)->setParameter('param', $what);
$paginator = $this->get('knp_paginator');
$pagination = $paginator->paginate(
$query,
$request->query->getInt('page', 1),45
);