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 315)
  1.      * @param string $objname
  2.      * @return array
  3.      **********************************************/
  4.     public function getObjectTotalStats($objname="")
  5.     {
  6.         $conn $this->getEntityManager()->getConnection();
  7.         return $conn->fetchAllAssociative("
  8.             SELECT 
  9.                 a.object as ObjName, 
  10.                 filter as ImageFilter, 
IqpRepository->getObjectTotalStats() in src/IqpBundle/Controller/StatController.php (line 191)
  1.         } else {
  2.             //Конкретный объект
  3.             $sessioname $objname;
  4.             //1.1. Get objects total
  5.             $objectlist_total $this->iqpRepo->getObjectTotalStats($objname);
  6.             //1.2. Get objectlist with filters
  7.             $objectlist $this->iqpRepo->getObjectByFilterStats($objname);
  8.             //2. Get imagelist for object
in vendor/symfony/http-kernel/HttpKernel.php -> displayAnalyticsByObjectAction (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:315)
  at App\IqpBundle\Entity\Repo\IqpRepository->getObjectTotalStats()
     (src/IqpBundle/Controller/StatController.php:191)
  at App\IqpBundle\Controller\StatController->displayAnalyticsByObjectAction()
     (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)