if (null === $manager = $this->doctrine->getManagerForClass($entityConfig['class'])) {
throw new \RuntimeException(sprintf('There is no Doctrine Entity Manager defined for the "%s" class', $entityConfig['class']));
}
if (null === $entity = $manager->getRepository($entityConfig['class'])->find($itemId)) {
throw new EntityNotFoundException(['entity_name' => $entityConfig['name'], 'entity_id_name' => $entityConfig['primary_key_field_name'], 'entity_id_value' => $itemId]);
}
return $entity;
}
}
}
$request->attributes->set('easyadmin', [
'entity' => $entity = $event->getArgument('entity'),
'view' => $request->query->get('action', 'list'),
'item' => (null !== $id = $request->query->get('id')) ? $this->findCurrentItem($entity, $id) : null,
]);
}
/**
* Looks for the object that corresponds to the selected 'id' of the current entity.
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
public function handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $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
EntityNotFoundException |
---|
EasyCorp\Bundle\EasyAdminBundle\Exception\EntityNotFoundException: The "Editor" entity with "id = 29" does not exist in the database. The entity may have been deleted by mistake or by a "cascade={"remove"}" operation executed by Doctrine. at vendor/easycorp/easyadmin-bundle/src/EventListener/RequestPostInitializeListener.php:69 at EasyCorp\Bundle\EasyAdminBundle\EventListener\RequestPostInitializeListener->findCurrentItem() (vendor/easycorp/easyadmin-bundle/src/EventListener/RequestPostInitializeListener.php:47) at EasyCorp\Bundle\EasyAdminBundle\EventListener\RequestPostInitializeListener->initializeRequest() (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:117) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() (vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:151) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (vendor/easycorp/easyadmin-bundle/src/Controller/AdminControllerTrait.php:149) at EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController->dispatch() (vendor/easycorp/easyadmin-bundle/src/Controller/AdminControllerTrait.php:133) at EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController->initialize() (vendor/easycorp/easyadmin-bundle/src/Controller/AdminControllerTrait.php:65) at EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController->indexAction() (vendor/symfony/http-kernel/HttpKernel.php:157) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:79) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:195) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:24) |