class FeatureNotImplemented extends CacheException
{
public static function scalarResults(): self
{
return new self('Second level cache does not support scalar results.');
}
public static function multipleRootEntities(): self
{
return new self('Second level cache does not support multiple root entities.');
* {@inheritDoc}
*/
public function put(QueryCacheKey $key, ResultSetMapping $rsm, $result, array $hints = [])
{
if ($rsm->scalarMappings) {
throw FeatureNotImplemented::scalarResults();
}
if (count($rsm->entityMappings) > 1) {
throw FeatureNotImplemented::multipleRootEntities();
}
return $result;
}
$result = $this->executeIgnoreQueryCache($parameters, $hydrationMode);
$cached = $queryCache->put($queryKey, $rsm, $result, $this->_hints);
if ($this->cacheLogger) {
$this->cacheLogger->queryCacheMiss($queryCache->getRegion()->getName(), $queryKey);
if ($cached) {
* @return mixed
*/
public function execute($parameters = null, $hydrationMode = null)
{
if ($this->cacheable && $this->isCacheEnabled()) {
return $this->executeUsingQueryCache($parameters, $hydrationMode);
}
return $this->executeIgnoreQueryCache($parameters, $hydrationMode);
}
*
* @return mixed[]
*/
public function getArrayResult()
{
return $this->execute(null, self::HYDRATE_ARRAY);
}
/**
* Gets one-dimensional array of results for the query.
*
$queryBuilder->setFirstResult($limit['start'])
->setMaxResults($limit['max']);
$query = $queryBuilder->setCacheable(true)->getQuery()->useQueryCache(true);
return $query->getArrayResult(Query::HYDRATE_ARRAY);
}
// {{{ getListSpectacles()
/** Récupére la liste des spectacles
foreach ($listPossibleRecommandationNb as $key => $value) {
if ($value['totalRecommandation'] == 1) {
unset($listPossibleRecommandationNb[$key]);
} else {
/* just check if there is really at least 1 spectacle with the nb of recommandations because of a bug */
$testSpectacleExist = $spectacleRepo->getRecommandedSpectacles($value['totalRecommandation'], ['start' => 0, 'max' => 1]);
if (empty($testSpectacleExist)) {
unset($listPossibleRecommandationNb[$key]);
continue;
}
$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);
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
Debug::enable();
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
FeatureNotImplemented
|
---|
Doctrine\ORM\Cache\Exception\FeatureNotImplemented: Second level cache does not support scalar results. at /home/web/theatre-contemporain.net/dev/vendor/doctrine/orm/lib/Doctrine/ORM/Cache/Exception/FeatureNotImplemented.php:11 at Doctrine\ORM\Cache\Exception\FeatureNotImplemented::scalarResults() (/home/web/theatre-contemporain.net/dev/vendor/doctrine/orm/lib/Doctrine/ORM/Cache/DefaultQueryCache.php:234) at Doctrine\ORM\Cache\DefaultQueryCache->put() (/home/web/theatre-contemporain.net/dev/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1286) at Doctrine\ORM\AbstractQuery->executeUsingQueryCache() (/home/web/theatre-contemporain.net/dev/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1163) at Doctrine\ORM\AbstractQuery->execute() (/home/web/theatre-contemporain.net/dev/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:913) at Doctrine\ORM\AbstractQuery->getArrayResult() (/home/web/theatre-contemporain.net/dev/vendor/theatre/core/src/Repository/SpectaclesRepository.php:2697) at TheatreCore\Repository\SpectaclesRepository->getRecommandedSpectacles() (/home/web/theatre-contemporain.net/dev/src/Controller/CritiquesController.php:961) at App\Controller\CritiquesController->action_recommandations() (/home/web/theatre-contemporain.net/dev/vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (/home/web/theatre-contemporain.net/dev/vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (/home/web/theatre-contemporain.net/dev/vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (/home/web/theatre-contemporain.net/dev/public/index.php:20) |