private function initialize(): void
{
$manager = $this->registry->getManagerForClass($this->entityClass);
if ($manager === null) {
throw new LogicException(sprintf(
'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.',
$this->entityClass,
));
}
}
/** @return mixed */
public function __get(string $name)
{
$this->initialize();
$scope = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['class'] ?? null;
return (function () use ($name) {
return $this->$name;
}
/** @return EntityManagerInterface */
protected function getEntityManager()
{
return $this->_em;
}
/**
* @return ClassMetadata
* @psalm-return ClassMetadata<T>
* @param string $objname
* @return array
**********************************************/
public function getObjectTotalStats($objname="")
{
$conn = $this->getEntityManager()->getConnection();
return $conn->fetchAllAssociative("
SELECT
a.object as ObjName,
filter as ImageFilter,
} else {
//Конкретный объект
$sessioname = $objname;
//1.1. Get objects total
$objectlist_total = $this->iqpRepo->getObjectTotalStats($objname);
//1.2. Get objectlist with filters
$objectlist = $this->iqpRepo->getObjectByFilterStats($objname);
//2. Get imagelist for object
$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, $event);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
$response = null;
try {
return $response = $this->handleRaw($request, $type);
} catch (\Throwable $e) {
if ($e instanceof \Error && !$this->handleAllThrowables) {
throw $e;
}
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
) {
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
if (Kernel::VERSION_ID >= 60400) {
$response->send(false);
if (\function_exists('fastcgi_finish_request') && !$this->debug) {
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel('dev', true);
return new Kernel('prod', false);
};
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) |