*/
public function getAttributesAjax(Request $request)
{
$em = $this->getDoctrine()->getManager();
/** @var Product $product */
$product = $em->getRepository('CatalogBundle:Product')->find($request->get('id'));
// die(VarDumper::dump($product));
$productAttributes = $product->getProductAttributes();
$attributes = array();
$items = array();
if (!empty($productAttributes)) {
$this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS, $event);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = \call_user_func_array($controller, $arguments);
// view
if (!$response instanceof Response) {
$event = new GetResponseForControllerResultEvent($this, $request, $type, $response);
$this->dispatcher->dispatch(KernelEvents::VIEW, $event);
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
No log messages
ORMException |
---|
Doctrine\ORM\ORMException: The identifier id is missing for a query of CatalogBundle\Entity\Product at vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php:315 at Doctrine\ORM\ORMException::missingIdentifierField() (vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:422) at Doctrine\ORM\EntityManager->find() (vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:151) at Doctrine\ORM\EntityRepository->find() (src/CatalogBundle/Controller/DefaultController.php:145) at CatalogBundle\Controller\DefaultController->getAttributesAjax() (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200) at Symfony\Component\HttpKernel\Kernel->handle() (web/app.php:23) |