public function singleBungalow($slug, $category)
{
$bungalow = $this->getDoctrine()->getRepository(Bungalow::Class)->findOneBy(['slug' => $slug]);
$bungalowAddFiles = array();
$bungalowAddFiles['bungalow'] = $bungalow;
$bungalowAddFiles['mainImage'] = $this->getDoctrine()->getRepository(File::class)->findOneBy(array('itemId' => $bungalow->getId(), 'section' => 'bungalow', 'type' => 'mainImage'));
$bungalowAddFiles['gallery'] = $this->getDoctrine()->getRepository(File::class)->findBy(array('itemId' => $bungalow->getId(), 'section' => 'bungalow', 'type' => 'gallery'), ['sort'=>'ASC']);
$bungalowAddFiles['mapImage'] = $this->getDoctrine()->getRepository(File::class)->findOneBy(array('itemId' => $bungalow->getId(), 'section' => 'bungalow', 'type' => 'mapImage'));
$relatedBungalowsList = $this->getDoctrine()->getRepository(RelatedBungalow::class)->findBy(['bungalowId' => $bungalow->getId()], ['sort'=>'ASC']);
$bungalowAddFiles['stamp'] = null;
$bungalowAddFiles['stamps'] = null;
$this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS, $event);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $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', 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
Error |
---|
Error: Call to a member function getId() on null at src/Controller/Frontend/StayController.php:71 at App\Controller\Frontend\StayController->singleBungalow('coco-sweet', 'tent') (vendor/symfony/http-kernel/HttpKernel.php:150) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:67) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:198) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (public/index.php:37) |