Execute query ignoring second level cache.

@param ArrayCollection|array|Parameter[]|mixed[]|null $parameters
@param int|null                                       $hydrationMode

@return mixed
509678
private function executeIgnoreQueryCache($parameters = null, $hydrationMode = null)
    {
        if ($hydrationMode !== null) {
            $this->setHydrationMode($hydrationMode);
        }

        if (! empty($parameters)) {
            $this->setParameters($parameters);
        }

        $setCacheEntry = static function () {
        };

        if ($this->hydrationCacheProfile !== null) {
            [$cacheKey, $realCacheKey] = $this->getHydrationCacheId();

            $queryCacheProfile = $this->getHydrationCacheProfile();
            $cache             = $queryCacheProfile->getResultCacheDriver();
            $result            = $cache->fetch($cacheKey);

            if (isset($result[$realCacheKey])) {
                return $result[$realCacheKey];
            }

            if (! $result) {
                $result = [];
            }

            $setCacheEntry = static function ($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) {
                $result[$realCacheKey] = $data;

                $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime());
            };
        }

        $stmt = $this->doExecute();

        if (is_numeric($stmt)) {
            $setCacheEntry($stmt);

            return $stmt;
        }

        $rsm  = $this->getResultSetMapping();
        $data = $this->em->newHydrator($this->hydrationMode)->hydrateAll($stmt, $rsm, $this->hints);

        $setCacheEntry($data);

        return $data;
    }
256792
protected function setResult($hydratorset = null, $callback = null) {

        $res = $this->builder->getQuery()->execute();
        $call = "Searcher\\Searcher\\Hydrators\\" . ucfirst($hydratorset) . "Hydrator";

        if ($res->valid() === true) {

            if(class_exists($call) === true) {

                $res = (new $call($res))->extract($callback);

            }
            return $res;
        }
        return null;

    }
714147
public function execute(BlockInterface $block, Response $response = null, array $parameters = [])
    {
        $this->loadCollection($block);

        return parent::execute($block, $response, $parameters);
    }
1012899
public function hydrateAll($stmt, $resultSetMapping, array $hints = [])
    {
        if ($logger = $this->_em->getConfiguration()->getHydrationLogger()) {
            $type = null;

            if ($this instanceof ObjectHydrator) {
                $type = 'ObjectHydrator';
            } elseif ($this instanceof ArrayHydrator) {
                $type = 'ArrayHydrator';
            } elseif ($this instanceof ScalarHydrator) {
                $type = 'ScalarHydrator';
            } elseif ($this instanceof SimpleObjectHydrator) {
                $type = 'SimpleObjectHydrator';
            } elseif ($this instanceof SingleScalarHydrator) {
                $type = 'SingleScalarHydrator';
            }

            $logger->start($type);
        }

        $result = parent::hydrateAll($stmt, $resultSetMapping, $hints);

        if ($logger) {
            if (is_array($result) || $result instanceof Countable) {
                $logger->stop(sizeof($result), $resultSetMapping->getAliasMap());
            }
        }

        return $result;
    }
1164959
public function runDql($dql, $hydrationMode = \Doctrine\ORM\Query::HYDRATE_OBJECT, $firstResult = null, $maxResult = null)
    {
        /** @var \Doctrine\ORM\Query $query */
        $query = $this->entityManager->createQuery($dql);
        if ($firstResult !== null) {
            $query->setFirstResult($firstResult);
        }
        if ($maxResult !== null) {
            $query->setMaxResults($maxResult);
        }

        return $query->execute([], $hydrationMode);
    }
595166
public function fetch($hydrationMode = self::HYDRATE_OBJECT)
	{
		if (null === $this->resultSet) {
			$items = [];
			$objectRepository = $this->objectManager->getRepository($this->className);
			
			if ($this->countItemsCallable instanceof \Closure) {
				$fn = $this->countItemsCallable;
				$this->fullyItems = $fn($objectRepository, $this->_queryParts['where']);
					
				if (!is_integer($this->fullyItems)) {
					throw new \UnexpectedValueException('The closure "countItemsCallable" returned an unexcepted value.');
				}
			} elseif ($this->countQuery instanceof \Doctrine\ORM\Query/* || $this->countQuery instanceof \Doctrine\ODM\MongoDB\Query\Query*/) {
				$this->fullyItems = $this->countQuery->getSingleScalarResult();
			} else {
				$this->internalCountQuery = $this->createCountQuery($this->_queryParts['select'], $this->_queryParts['where'], $this->_queryParts['distinct']);
				$this->fullyItems = (int) ($this->internalCountQuery instanceof \Doctrine\ORM\Query ?
						$this->internalCountQuery->getSingleScalarResult() : $this->internalCountQuery->execute());
			}
			
			if ($this->fullyItems > 0) {
				if ($this->selectItemsCallable instanceof \Closure) {
					$fn = $this->selectItemsCallable;
					$items = $fn($objectRepository, $this->_queryParts['where'], $this->_queryParts['orderBy'], $this->itemPerPage, $this->getItemOffset());
			
					if (!is_array($items)) {
						throw new \UnexpectedValueException('The closure "selectItemsCallable" returned an unexcepted value.');
					}
				} elseif ($this->selectQuery instanceof \Doctrine\ORM\Query) {
					$items = $this->selectQuery->setFirstResult($this->getItemOffset())
												->setMaxResults($this->itemPerPage)
												->getResult();
				} else {
					$this->internalSelectQuery = $this->createSelectQuery($this->_queryParts['select'], $this->_queryParts['where'], $this->_queryParts['orderBy'], $this->_queryParts['distinct']);
					$items = $this->internalSelectQuery instanceof \Doctrine\ORM\Query ?
					$this->internalSelectQuery->getResult() : $this->internalSelectQuery->execute()->toArray(false);
				}
			}
			
			// Set pagination result set
			$this->setResultSet($items);
			
			if (isset($this->options['twig_extension_enabled']) && true === $this->options['twig_extension_enabled']) {
				$globals = $this->twig->getGlobals();
					
				if (isset($globals[OkaPaginationExtension::TWIG_GLOBAL_VAR_NAME])) {
					$globals[OkaPaginationExtension::TWIG_GLOBAL_VAR_NAME][$this->managerName] = $this->resultSet->toArray(['items']);
					$this->twig->addGlobal(OkaPaginationExtension::TWIG_GLOBAL_VAR_NAME, $globals[OkaPaginationExtension::TWIG_GLOBAL_VAR_NAME]);
				}
			}
		}
		
		return $hydrationMode == self::HYDRATE_ARRAY ? $this->resultSet->toArray() : $this->resultSet;
	}
654171
protected function hydrateSingleResult($item, $hydrationMode, $refresh, $readOnly, array $primers)
    {
        if ($item === null) {
            return $item;
        }

        switch ($hydrationMode) {
            case self::RESULT_TYPE_HYDRATED:
                $document = $this->dm->getUnitOfWork()->getOrCreateDocument(
                    $this->getClass(),
                    $item,
                    null,
                    $refresh,
                    $readOnly
                );

                if (!empty($primers)) {
                    $referencePrimer = new ReferencePrimer($this->dm, $this->dm->getUnitOfWork());

                    foreach ($primers as $attributeName => $primer) {
                        $primer = is_callable($primer) ? $primer : null;
                        $referencePrimer->primeReferences(
                            $this->getClass(),
                            [$document],
                            $attributeName,
                            $refresh,
                            $readOnly,
                            $primer
                        );
                    }
                }

                return $document;

            case self::RESULT_TYPE_MARSHALLED:
                return $item;

            case self::RESULT_TYPE_UNMARSHALLED:
                $map = [MapType::$dynamoKey => $item];

                return Type::convertUnmappedToPHPValue($map);
        }

        throw new \LogicException;
    }
859324
public function getPaginatedEntities(array $options = [], $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
    {
        $options = PaginatedEntityRepositoryOptionsResolver::createAndResolve($options);
        $queryBuilder = $this->addPagination(
            $this->getQueryBuilder($options['filters'], $options['sorting']),
            $options['elementsPerPage'],
            $options['page']
        );

        return new Paginator($queryBuilder->getQuery()->setHydrationMode($hydrationMode));
    }
60276
public function execute(array $params = null)
    {
        /*
         * Simple case - no query profiler to manage.
         */
        if ($this->_queryId === null) {
            return $this->_execute($params);
        }

        /*
         * Do the same thing, but with query profiler
         * management before and after the execute.
         */
        $prof = $this->_adapter->getProfiler();
        $qp = $prof->getQueryProfile($this->_queryId);
        if ($qp->hasEnded()) {
            $this->_queryId = $prof->queryClone($qp);
            $qp = $prof->getQueryProfile($this->_queryId);
        }
        if ($params !== null) {
            $qp->bindParams($params);
        } else {
            $qp->bindParams($this->_bindParam);
        }
        $qp->start($this->_queryId);

        $retval = $this->_execute($params);

        $prof->queryEnd($this->_queryId);

        return $retval;
    }
124524
public function getAllSortBy($sort, $order = 'DESC', $hydrationMode = Query::HYDRATE_OBJECT)
    {
        $query = $this->getAllSortByQuery($sort, $order);

        return $query->execute([], $hydrationMode);
    }
89193
public function hydrateLegacyHandler(HydrationEvent $event)
    {
        $entity = $event->getArgument('entity');
        if ($entity instanceof Content) {
            $entity->setLegacyService($this->legacy);
        }
    }
1053826
final public function run($hydratorset = null, $callback = null)
    {

        try {
            // call to get result

            $result = (new Builder($this))->loop($hydratorset, $callback);

            return $result;

        } catch (ExceptionFactory $e) {
            echo $e->getMessage();
        }

    }
618269
public function selectManyModels(Select $select, HydratorInterface $hydrator = null, AbstractModel $model = null)
    {
        $resultSet = new ResultSet\HydratingResultSet($this->getHydrator(), $this->getModel());
        return $this->selectMany($select, $resultSet);
    }
338001
public function hydrate($puppetModules, $group)
    {
        $availableClasses = [];
        if (!empty($puppetModules)) {
            foreach ($puppetModules as $puppetModule) {
                if ($puppetModule->hasClasses()) {
                    foreach ($puppetModule->getClasses() as $puppetClass) {
                        $groupClass = $group->getClassByName($puppetClass->getName());
                        if ($groupClass != null) {
                            if ($puppetClass->hasParametersTemplates()) {
                                $this->groupClassHydrator->hydrate($puppetClass->getParametersTemplates(), $groupClass);
                            }
                        } else {
                            $availableClasses[$puppetModule->getName()][] = $puppetClass->getName();
                        }
                    }
                }
            }
        }
        return $group->setAvailableClasses($availableClasses);
    }
424584
public static function hydrateCollection(array $contexts)
    {
        $hydrated = [];

        foreach ($contexts as $context) {
            $hydrated[] = self::hydrate($context);
        }

        return $hydrated;
    }
1070749
public static function hydrate(stdClass $ignore)
    {
        $hydrated = new IgnoredLocationEntity();

        if (isset($ignore->id)) {
            $hydrated->setId($ignore->id);
        }

        if (isset($ignore->path)) {
            $hydrated->setPath($ignore->path);
        }

        if (isset($ignore->match)) {
            $hydrated->setMatch($ignore->match);
        }

        if (isset($ignore->exclude)) {
            $hydrated->setExclude($ignore->exclude);
        }

        return $hydrated;
    }
893443
public function hydrate($incoming, $model, Map $context = null)
    {
        $callable = $this->getDelegateHydrator();

        if (null === $context && $this->provide_fallback_context) {
            // Provide a non-null context so null checks aren't later required
            $context = new Map();
        }

        return $callable($incoming, $model, $context);
    }