tName(); return $key === $parameterName; }); return !$filteredParameters->isEmpty() ? $filteredParameters->first() : null; } public function setParameters($parameters) { if (is_array($parameters)) { $parameterCollection = new ArrayCollection(); foreach ($parameters as $key => $value) { $parameterCollection->add(new Parameter($key, $value)); } $parameters = $parameterCollection; } $this->parameters = $parameters; return $this; } public function setParameter($key, $value, $type = null) { $existingParameter = $this->getParameter($key); if ($existingParameter !== null) { $existingParameter->setValue($value, $type); return $this; } $this->parameters->add(new Parameter($key, $value, $type)); return $this; } public function processParameterValue($value) { if (is_scalar($value)) { return $value; } if ($value instanceof Collection) { $value = iterator_to_array($value); } if (is_array($value)) { $value = $this->processArrayParameterValue($value); return $value; } if ($value instanceof Mapping\ClassMetadata) { return $value->name; } if ($value instanceof BackedEnum) { return $value->value; } if (!is_object($value)) { return $value; } try { $class = ClassUtils::getClass($value); $value = $this->_em->getUnitOfWork()->getSingleIdentifierValue($value); if ($value === null) { throw ORMInvalidArgumentException::invalidIdentifierBindingEntity($class); } } catch (MappingException|ORMMappingException $e) { $value = $this->potentiallyProcessIterable($value); } return $value; } private function potentiallyProcessIterable($value) { if ($value instanceof Traversable) { $value = iterator_to_array($value); $value = $this->processArrayParameterValue($value); } return $value; } private function processArrayParameterValue(array $value) : array { foreach ($value as $key => $paramValue) { $paramValue = $this->processParameterValue($paramValue); $value[$key] = is_array($paramValue) ? reset($paramValue) : $paramValue; } return $value; } public function setResultSetMapping(Query\ResultSetMapping $rsm) { $this->translateNamespaces($rsm); $this->_resultSetMapping = $rsm; return $this; } protected function getResultSetMapping() { return $this->_resultSetMapping; } private function translateNamespaces(Query\ResultSetMapping $rsm) : void { $translate = function ($alias) : string { return $this->_em->getClassMetadata($alias)->getName(); }; $rsm->aliasMap = array_map($translate, $rsm->aliasMap); $rsm->declaringClasses = array_map($translate, $rsm->declaringClasses); } public function setHydrationCacheProfile(?QueryCacheProfile $profile = null) { if ($profile === null) { if (func_num_args() < 1) { Deprecation::trigger('doctrine/orm', 'https://github.com/doctrine/orm/pull/9791', 'Calling %s without arguments is deprecated, pass null instead.', __METHOD__); } $this->_hydrationCacheProfile = null; return $this; } // DBAL 2 if (!method_exists(QueryCacheProfile::class, 'setResultCache')) { if (!$profile->getResultCacheDriver()) { $defaultHydrationCacheImpl = $this->_em->getConfiguration()->getHydrationCache(); if ($defaultHydrationCacheImpl) { $profile = $profile->setResultCacheDriver(DoctrineProvider::wrap($defaultHydrationCacheImpl)); } } } elseif (!$profile->getResultCache()) { $defaultHydrationCacheImpl = $this->_em->getConfiguration()->getHydrationCache(); if ($defaultHydrationCacheImpl) { $profile = $profile->setResultCache($defaultHydrationCacheImpl); } } $this->_hydrationCacheProfile = $profile; return $this; } public function getHydrationCacheProfile() { return $this->_hydrationCacheProfile; } public function setResultCacheProfile(?QueryCacheProfile $profile = null) { if ($profile === null) { if (func_num_args() < 1) { Deprecation::trigger('doctrine/orm', 'https://github.com/doctrine/orm/pull/9791', 'Calling %s without arguments is deprecated, pass null instead.', __METHOD__); } $this->_queryCacheProfile = null; return $this; } // DBAL 2 if (!method_exists(QueryCacheProfile::class, 'setResultCache')) { if (!$profile->getResultCacheDriver()) { $defaultResultCacheDriver = $this->_em->getConfiguration()->getResultCache(); if ($defaultResultCacheDriver) { $profile = $profile->setResultCacheDriver(DoctrineProvider::wrap($defaultResultCacheDriver)); } } } elseif (!$profile->getResultCache()) { $defaultResultCache = $this->_em->getConfiguration()->getResultCache(); if ($defaultResultCache) { $profile = $profile->setResultCache($defaultResultCache); } } $this->_queryCacheProfile = $profile; return $this; } public function setResultCacheDriver($resultCacheDriver = null) { if ($resultCacheDriver !== null && !$resultCacheDriver instanceof \MailPoetVendor\Doctrine\Common\Cache\Cache) { throw InvalidResultCacheDriver::create(); } return $this->setResultCache($resultCacheDriver ? CacheAdapter::wrap($resultCacheDriver) : null); } public function setResultCache(?CacheItemPoolInterface $resultCache = null) { if ($resultCache === null) { if (func_num_args() < 1) { Deprecation::trigger('doctrine/orm', 'https://github.com/doctrine/orm/pull/9791', 'Calling %s without arguments is deprecated, pass null instead.', __METHOD__); } if ($this->_queryCacheProfile) { $this->_queryCacheProfile = new QueryCacheProfile($this->_queryCacheProfile->getLifetime(), $this->_queryCacheProfile->getCacheKey()); } return $this; } // DBAL 2 if (!method_exists(QueryCacheProfile::class, 'setResultCache')) { $resultCacheDriver = DoctrineProvider::wrap($resultCache); $this->_queryCacheProfile = $this->_queryCacheProfile ? $this->_queryCacheProfile->setResultCacheDriver($resultCacheDriver) : new QueryCacheProfile(0, null, $resultCacheDriver); return $this; } $this->_queryCacheProfile = $this->_queryCacheProfile ? $this->_queryCacheProfile->setResultCache($resultCache) : new QueryCacheProfile(0, null, $resultCache); return $this; } public function getResultCacheDriver() { if ($this->_queryCacheProfile && $this->_queryCacheProfile->getResultCacheDriver()) { return $this->_queryCacheProfile->getResultCacheDriver(); } return $this->_em->getConfiguration()->getResultCacheImpl(); } public function useResultCache($useCache, $lifetime = null, $resultCacheId = null) { return $useCache ? $this->enableResultCache($lifetime, $resultCacheId) : $this->disableResultCache(); } public function enableResultCache(?int $lifetime = null, ?string $resultCacheId = null) : self { $this->setResultCacheLifetime($lifetime); $this->setResultCacheId($resultCacheId); return $this; } public function disableResultCache() : self { $this->_queryCacheProfile = null; return $this; } public function setResultCacheLifetime($lifetime) { $lifetime = (int) $lifetime; if ($this->_queryCacheProfile) { $this->_queryCacheProfile = $this->_queryCacheProfile->setLifetime($lifetime); return $this; } $this->_queryCacheProfile = new QueryCacheProfile($lifetime); $cache = $this->_em->getConfiguration()->getResultCache(); if (!$cache) { return $this; } // Compatibility for DBAL 2 if (!method_exists($this->_queryCacheProfile, 'setResultCache')) { $this->_queryCacheProfile = $this->_queryCacheProfile->setResultCacheDriver(DoctrineProvider::wrap($cache)); return $this; } $this->_queryCacheProfile = $this->_queryCacheProfile->setResultCache($cache); return $this; } public function getResultCacheLifetime() { return $this->_queryCacheProfile ? $this->_queryCacheProfile->getLifetime() : 0; } public function expireResultCache($expire = \true) { $this->_expireResultCache = $expire; return $this; } public function getExpireResultCache() { return $this->_expireResultCache; } public function getQueryCacheProfile() { return $this->_queryCacheProfile; } public function setFetchMode($class, $assocName, $fetchMode) { if (!in_array($fetchMode, [Mapping\ClassMetadata::FETCH_EAGER, Mapping\ClassMetadata::FETCH_LAZY], \true)) { Deprecation::trigger('doctrine/orm', 'https://github.com/doctrine/orm/pull/9777', 'Calling %s() with something else than ClassMetadata::FETCH_EAGER or ClassMetadata::FETCH_LAZY is deprecated.', __METHOD__); $fetchMode = Mapping\ClassMetadata::FETCH_LAZY; } $this->_hints['fetchMode'][$class][$assocName] = $fetchMode; return $this; } public function setHydrationMode($hydrationMode) { $this->_hydrationMode = $hydrationMode; return $this; } public function getHydrationMode() { return $this->_hydrationMode; } public function getResult($hydrationMode = self::HYDRATE_OBJECT) { return $this->execute(null, $hydrationMode); } public function getArrayResult() { return $this->execute(null, self::HYDRATE_ARRAY); } public function getSingleColumnResult() { return $this->execute(null, self::HYDRATE_SCALAR_COLUMN); } public function getScalarResult() { return $this->execute(null, self::HYDRATE_SCALAR); } public function getOneOrNullResult($hydrationMode = null) { try { $result = $this->execute(null, $hydrationMode); } catch (NoResultException $e) { return null; } if ($this->_hydrationMode !== self::HYDRATE_SINGLE_SCALAR && !$result) { return null; } if (!is_array($result)) { return $result; } if (count($result) > 1) { throw new NonUniqueResultException(); } return array_shift($result); } public function getSingleResult($hydrationMode = null) { $result = $this->execute(null, $hydrationMode); if ($this->_hydrationMode !== self::HYDRATE_SINGLE_SCALAR && !$result) { throw new NoResultException(); } if (!is_array($result)) { return $result; } if (count($result) > 1) { throw new NonUniqueResultException(); } return array_shift($result); } public function getSingleScalarResult() { return $this->getSingleResult(self::HYDRATE_SINGLE_SCALAR); } public function setHint($name, $value) { $this->_hints[$name] = $value; return $this; } public function getHint($name) { return $this->_hints[$name] ?? \false; } public function hasHint($name) { return isset($this->_hints[$name]); } public function getHints() { return $this->_hints; } public function iterate($parameters = null, $hydrationMode = null) { Deprecation::trigger('doctrine/orm', 'https://github.com/doctrine/orm/issues/8463', 'Method %s() is deprecated and will be removed in Doctrine ORM 3.0. Use toIterable() instead.', __METHOD__); if ($hydrationMode !== null) { $this->setHydrationMode($hydrationMode); } if (!empty($parameters)) { $this->setParameters($parameters); } $rsm = $this->getResultSetMapping(); if ($rsm === null) { throw new LogicException('Uninitialized result set mapping.'); } $stmt = $this->_doExecute(); return $this->_em->newHydrator($this->_hydrationMode)->iterate($stmt, $rsm, $this->_hints); } public function toIterable(iterable $parameters = [], $hydrationMode = null) : iterable { if ($hydrationMode !== null) { $this->setHydrationMode($hydrationMode); } if ($this->isCountable($parameters) && count($parameters) !== 0 || $parameters instanceof Traversable && iterator_count($parameters) !== 0) { $this->setParameters($parameters); } $rsm = $this->getResultSetMapping(); if ($rsm === null) { throw new LogicException('Uninitialized result set mapping.'); } if ($rsm->isMixed && count($rsm->scalarMappings) > 0) { throw QueryException::iterateWithMixedResultNotAllowed(); } $stmt = $this->_doExecute(); return $this->_em->newHydrator($this->_hydrationMode)->toIterable($stmt, $rsm, $this->_hints); } public function execute($parameters = null, $hydrationMode = null) { if ($this->cacheable && $this->isCacheEnabled()) { return $this->executeUsingQueryCache($parameters, $hydrationMode); } return $this->executeIgnoreQueryCache($parameters, $hydrationMode); } private function executeIgnoreQueryCache($parameters = null, $hydrationMode = null) { if ($hydrationMode !== null) { $this->setHydrationMode($hydrationMode); } if (!empty($parameters)) { $this->setParameters($parameters); } $setCacheEntry = static function ($data) : void { }; if ($this->_hydrationCacheProfile !== null) { [$cacheKey, $realCacheKey] = $this->getHydrationCacheId(); $cache = $this->getHydrationCache(); $cacheItem = $cache->getItem($cacheKey); $result = $cacheItem->isHit() ? $cacheItem->get() : []; if (isset($result[$realCacheKey])) { return $result[$realCacheKey]; } if (!$result) { $result = []; } $setCacheEntry = static function ($data) use($cache, $result, $cacheItem, $realCacheKey) : void { $cache->save($cacheItem->set($result + [$realCacheKey => $data])); }; } $stmt = $this->_doExecute(); if (is_numeric($stmt)) { $setCacheEntry($stmt); return $stmt; } $rsm = $this->getResultSetMapping(); if ($rsm === null) { throw new LogicException('Uninitialized result set mapping.'); } $data = $this->_em->newHydrator($this->_hydrationMode)->hydrateAll($stmt, $rsm, $this->_hints); $setCacheEntry($data); return $data; } private function getHydrationCache() : CacheItemPoolInterface { assert($this->_hydrationCacheProfile !== null); // Support for DBAL 2 if (!method_exists($this->_hydrationCacheProfile, 'getResultCache')) { $cacheDriver = $this->_hydrationCacheProfile->getResultCacheDriver(); assert($cacheDriver !== null); return CacheAdapter::wrap($cacheDriver); } $cache = $this->_hydrationCacheProfile->getResultCache(); assert($cache !== null); return $cache; } private function executeUsingQueryCache($parameters = null, $hydrationMode = null) { $rsm = $this->getResultSetMapping(); if ($rsm === null) { throw new LogicException('Uninitialized result set mapping.'); } $queryCache = $this->_em->getCache()->getQueryCache($this->cacheRegion); $queryKey = new QueryCacheKey($this->getHash(), $this->lifetime, $this->cacheMode ?: Cache::MODE_NORMAL, $this->getTimestampKey()); $result = $queryCache->get($queryKey, $rsm, $this->_hints); if ($result !== null) { if ($this->cacheLogger) { $this->cacheLogger->queryCacheHit($queryCache->getRegion()->getName(), $queryKey); } 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) { $this->cacheLogger->queryCachePut($queryCache->getRegion()->getName(), $queryKey); } } return $result; } private function getTimestampKey() : ?TimestampCacheKey { assert($this->_resultSetMapping !== null); $entityName = reset($this->_resultSetMapping->aliasMap); if (empty($entityName)) { return null; } $metadata = $this->_em->getClassMetadata($entityName); return new Cache\TimestampCacheKey($metadata->rootEntityName); } protected function getHydrationCacheId() { $parameters = []; $types = []; foreach ($this->getParameters() as $parameter) { $parameters[$parameter->getName()] = $this->processParameterValue($parameter->getValue()); $types[$parameter->getName()] = $parameter->getType(); } $sql = $this->getSQL(); assert(is_string($sql)); $queryCacheProfile = $this->getHydrationCacheProfile(); $hints = $this->getHints(); $hints['hydrationMode'] = $this->getHydrationMode(); ksort($hints); assert($queryCacheProfile !== null); return $queryCacheProfile->generateCacheKeys($sql, $parameters, $types, $hints); } public function setResultCacheId($id) { if (!$this->_queryCacheProfile) { return $this->setResultCacheProfile(new QueryCacheProfile(0, $id)); } $this->_queryCacheProfile = $this->_queryCacheProfile->setCacheKey($id); return $this; } public function getResultCacheId() { return $this->_queryCacheProfile ? $this->_queryCacheProfile->getCacheKey() : null; } protected abstract function _doExecute(); public function __clone() { $this->parameters = new ArrayCollection(); $this->_hints = []; $this->_hints = $this->_em->getConfiguration()->getDefaultQueryHints(); } protected function getHash() { $query = $this->getSQL(); assert(is_string($query)); $hints = $this->getHints(); $params = array_map(function (Parameter $parameter) { $value = $parameter->getValue(); // Small optimization // Does not invoke processParameterValue for scalar value if (is_scalar($value)) { return $value; } return $this->processParameterValue($value); }, $this->parameters->getValues()); ksort($hints); return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); } private function isCountable(iterable $subject) : bool { return $subject instanceof Countable || is_array($subject); } }
Fatal error: Uncaught Error: Class "MailPoetVendor\Doctrine\ORM\AbstractQuery" not found in /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Query.php:41 Stack trace: #0 /htdocs/wp-content/plugins/all-in-one-seo-pack/vendor/composer/ClassLoader.php(576): include() #1 /htdocs/wp-content/plugins/all-in-one-seo-pack/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}('/htdocs/wp-cont...') #2 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(481): Composer\Autoload\ClassLoader->loadClass('MailPoetVendor\\...') #3 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(79): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll(Array, NULL, NULL, NULL) #4 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(74): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy(Array) #5 /htdocs/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll() #6 /htdocs/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(147): MailPoet\Doctrine\Repository->findAll() #7 /htdocs/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded() #8 /htdocs/wp-content/plugins/mailpoet/lib/Config/Hooks.php(140): MailPoet\Settings\SettingsController->get('subscribe', Array) #9 /htdocs/wp-content/plugins/mailpoet/lib/Config/Hooks.php(121): MailPoet\Config\Hooks->setupSubscriptionEvents() #10 /htdocs/wp-content/plugins/mailpoet/lib/Config/Initializer.php(342): MailPoet\Config\Hooks->init() #11 /htdocs/wp-includes/class-wp-hook.php(324): MailPoet\Config\Initializer->pluginsLoaded('') #12 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #13 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #14 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #15 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #16 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #17 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #18 /htdocs/index.php(17): require('/htdocs/wp-blog...') #19 {main} thrown in /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Query.php on line 41