Symfony Exception

LogicException

HTTP 500 Internal Server Error

Could not find the entity manager for class "App\IqpBundle\Entity\Iqp". Check your Doctrine configuration to make sure it is configured to load this entity’s metadata.

Exception

LogicException

  1.     private function initialize(): void
  2.     {
  3.         $manager $this->registry->getManagerForClass($this->entityClass);
  4.         if ($manager === null) {
  5.             throw new LogicException(sprintf(
  6.                 'Could not find the entity manager for class "%s". Check your Doctrine configuration to make sure it is configured to load this entity’s metadata.',
  7.                 $this->entityClass,
  8.             ));
  9.         }
  1.     }
  2.     /** @return mixed */
  3.     public function __get(string $name)
  4.     {
  5.         $this->initialize();
  6.         $scope debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS2)[1]['class'] ?? null;
  7.         return (function () use ($name) {
  8.             return $this->$name;
  1.     }
  2.     /** @return EntityManagerInterface */
  3.     protected function getEntityManager()
  4.     {
  5.         return $this->_em;
  6.     }
  7.     /**
  8.      * @return ClassMetadata
  9.      * @psalm-return ClassMetadata<T>
EntityRepository->getEntityManager() in src/IqpBundle/Entity/Repo/IqpRepository.php (line 180)
  1.         return $sessrecs;
  2.     }
  3.     public function getImageListBySessionDate2($session_date)
  4.     {
  5.         $conn $this->getEntityManager()->getConnection();
  6.         $sessrecs $conn->fetchAllAssociative("
  7.             SELECT 
  8.                 DATE(DATE_SUB(a.date, INTERVAL 9 HOUR)) as datesess,
  9.                 CONVERT_TZ(a.date,'+00:00','+3:00') as DateObsMSK,
  10.                 TIME(CONVERT_TZ(a.date,'+00:00','+3:00')) as TimeObsMSK,
IqpRepository->getImageListBySessionDate2() in src/IqpBundle/Controller/StatController.php (line 145)
  1.         //1.2. Compose session date
  2.         $current_session_date_st$year."-".$month."-".$day;
  3.         //2.2. Get last session detailed data
  4.         $sessdetails=$this->iqpRepo->getImageListBySessionDate2($current_session_date_st);
  5.         //print_r($sessdetails);
  6.         //2.3. Get by object data for last session
  7.         $sessbyobj=$this->iqpRepo->getObjectDataBySessionDate2($current_session_date_st);
  8.         //print_r($sessbyobj);
in vendor/symfony/http-kernel/HttpKernel.php -> tabSessionAction (line 181)
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response$event);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2.         $this->requestStack->push($request);
  3.         $response null;
  4.         try {
  5.             return $response $this->handleRaw($request$type);
  6.         } catch (\Throwable $e) {
  7.             if ($e instanceof \Error && !$this->handleAllThrowables) {
  8.                 throw $e;
  9.             }
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  1.     ) {
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         if (Kernel::VERSION_ID >= 60400) {
  7.             $response->send(false);
  8.             if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in vendor/autoload_runtime.php -> run (line 29)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/www/astrohostel.ru/vendor/autoload_runtime.php') in web/app.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel('dev'true);
  6.     return new Kernel('prod'false);
  7. };

Stack Trace

LogicException
LogicException:
Could not find the entity manager for class "App\IqpBundle\Entity\Iqp". Check your Doctrine configuration to make sure it is configured to load this entity’s metadata.

  at vendor/doctrine/doctrine-bundle/Repository/LazyServiceEntityRepository.php:74
  at Doctrine\Bundle\DoctrineBundle\Repository\LazyServiceEntityRepository->initialize()
     (vendor/doctrine/doctrine-bundle/Repository/LazyServiceEntityRepository.php:49)
  at Doctrine\Bundle\DoctrineBundle\Repository\LazyServiceEntityRepository->__get()
     (vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:310)
  at Doctrine\ORM\EntityRepository->getEntityManager()
     (src/IqpBundle/Entity/Repo/IqpRepository.php:180)
  at App\IqpBundle\Entity\Repo\IqpRepository->getImageListBySessionDate2()
     (src/IqpBundle/Controller/StatController.php:145)
  at App\IqpBundle\Controller\StatController->tabSessionAction()
     (vendor/symfony/http-kernel/HttpKernel.php:181)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:197)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:29)
  at require_once('/www/astrohostel.ru/vendor/autoload_runtime.php')
     (web/app.php:5)