->_attributes['metadataCacheImpl']; } return isset($this->_attributes['metadataCache']) ? DoctrineProvider::wrap($this->_attributes['metadataCache']) : null; } public function setMetadataCacheImpl(CacheDriver $cacheImpl) { Deprecation::trigger('doctrine/orm', 'https://github.com/doctrine/orm/issues/8650', 'Method %s() is deprecated and will be removed in Doctrine ORM 3.0. Use setMetadataCache() instead.', __METHOD__); $this->_attributes['metadataCacheImpl'] = $cacheImpl; $this->_attributes['metadataCache'] = CacheAdapter::wrap($cacheImpl); } public function getMetadataCache() : ?CacheItemPoolInterface { return $this->_attributes['metadataCache'] ?? null; } public function setMetadataCache(CacheItemPoolInterface $cache) : void { $this->_attributes['metadataCache'] = $cache; $this->_attributes['metadataCacheImpl'] = DoctrineProvider::wrap($cache); } public function addNamedQuery($name, $dql) { $this->_attributes['namedQueries'][$name] = $dql; } public function getNamedQuery($name) { if (!isset($this->_attributes['namedQueries'][$name])) { throw NamedQueryNotFound::fromName($name); } return $this->_attributes['namedQueries'][$name]; } public function addNamedNativeQuery($name, $sql, Query\ResultSetMapping $rsm) { $this->_attributes['namedNativeQueries'][$name] = [$sql, $rsm]; } public function getNamedNativeQuery($name) { if (!isset($this->_attributes['namedNativeQueries'][$name])) { throw NamedNativeQueryNotFound::fromName($name); } return $this->_attributes['namedNativeQueries'][$name]; } public function ensureProductionSettings() { Deprecation::triggerIfCalledFromOutside('doctrine/orm', 'https://github.com/doctrine/orm/pull/9074', '%s is deprecated', __METHOD__); $queryCacheImpl = $this->getQueryCacheImpl(); if (!$queryCacheImpl) { throw QueryCacheNotConfigured::create(); } if ($queryCacheImpl instanceof ArrayCache) { throw QueryCacheUsesNonPersistentCache::fromDriver($queryCacheImpl); } if ($this->getAutoGenerateProxyClasses()) { throw ProxyClassesAlwaysRegenerating::create(); } if (!$this->getMetadataCache()) { throw MetadataCacheNotConfigured::create(); } $metadataCacheImpl = $this->getMetadataCacheImpl(); if ($metadataCacheImpl instanceof ArrayCache) { throw MetadataCacheUsesNonPersistentCache::fromDriver($metadataCacheImpl); } } public function addCustomStringFunction($name, $className) { $this->_attributes['customStringFunctions'][strtolower($name)] = $className; } public function getCustomStringFunction($name) { $name = strtolower($name); return $this->_attributes['customStringFunctions'][$name] ?? null; } public function setCustomStringFunctions(array $functions) { foreach ($functions as $name => $className) { $this->addCustomStringFunction($name, $className); } } public function addCustomNumericFunction($name, $className) { $this->_attributes['customNumericFunctions'][strtolower($name)] = $className; } public function getCustomNumericFunction($name) { $name = strtolower($name); return $this->_attributes['customNumericFunctions'][$name] ?? null; } public function setCustomNumericFunctions(array $functions) { foreach ($functions as $name => $className) { $this->addCustomNumericFunction($name, $className); } } public function addCustomDatetimeFunction($name, $className) { $this->_attributes['customDatetimeFunctions'][strtolower($name)] = $className; } public function getCustomDatetimeFunction($name) { $name = strtolower($name); return $this->_attributes['customDatetimeFunctions'][$name] ?? null; } public function setCustomDatetimeFunctions(array $functions) { foreach ($functions as $name => $className) { $this->addCustomDatetimeFunction($name, $className); } } public function setCustomHydrationModes($modes) { $this->_attributes['customHydrationModes'] = []; foreach ($modes as $modeName => $hydrator) { $this->addCustomHydrationMode($modeName, $hydrator); } } public function getCustomHydrationMode($modeName) { return $this->_attributes['customHydrationModes'][$modeName] ?? null; } public function addCustomHydrationMode($modeName, $hydrator) { $this->_attributes['customHydrationModes'][$modeName] = $hydrator; } public function setClassMetadataFactoryName($cmfName) { $this->_attributes['classMetadataFactoryName'] = $cmfName; } public function getClassMetadataFactoryName() { if (!isset($this->_attributes['classMetadataFactoryName'])) { $this->_attributes['classMetadataFactoryName'] = ClassMetadataFactory::class; } return $this->_attributes['classMetadataFactoryName']; } public function addFilter($name, $className) { $this->_attributes['filters'][$name] = $className; } public function getFilterClassName($name) { return $this->_attributes['filters'][$name] ?? null; } public function setDefaultRepositoryClassName($className) { $reflectionClass = new ReflectionClass($className); if (!$reflectionClass->implementsInterface(ObjectRepository::class)) { throw InvalidEntityRepository::fromClassName($className); } $this->_attributes['defaultRepositoryClassName'] = $className; } public function getDefaultRepositoryClassName() { return $this->_attributes['defaultRepositoryClassName'] ?? EntityRepository::class; } public function setNamingStrategy(NamingStrategy $namingStrategy) { $this->_attributes['namingStrategy'] = $namingStrategy; } public function getNamingStrategy() { if (!isset($this->_attributes['namingStrategy'])) { $this->_attributes['namingStrategy'] = new DefaultNamingStrategy(); } return $this->_attributes['namingStrategy']; } public function setQuoteStrategy(QuoteStrategy $quoteStrategy) { $this->_attributes['quoteStrategy'] = $quoteStrategy; } public function getQuoteStrategy() { if (!isset($this->_attributes['quoteStrategy'])) { $this->_attributes['quoteStrategy'] = new DefaultQuoteStrategy(); } return $this->_attributes['quoteStrategy']; } public function setEntityListenerResolver(EntityListenerResolver $resolver) { $this->_attributes['entityListenerResolver'] = $resolver; } public function getEntityListenerResolver() { if (!isset($this->_attributes['entityListenerResolver'])) { $this->_attributes['entityListenerResolver'] = new DefaultEntityListenerResolver(); } return $this->_attributes['entityListenerResolver']; } public function setRepositoryFactory(RepositoryFactory $repositoryFactory) { $this->_attributes['repositoryFactory'] = $repositoryFactory; } public function getRepositoryFactory() { return $this->_attributes['repositoryFactory'] ?? new DefaultRepositoryFactory(); } public function isSecondLevelCacheEnabled() { return $this->_attributes['isSecondLevelCacheEnabled'] ?? \false; } public function setSecondLevelCacheEnabled($flag = \true) { $this->_attributes['isSecondLevelCacheEnabled'] = (bool) $flag; } public function setSecondLevelCacheConfiguration(CacheConfiguration $cacheConfig) { $this->_attributes['secondLevelCacheConfiguration'] = $cacheConfig; } public function getSecondLevelCacheConfiguration() { if (!isset($this->_attributes['secondLevelCacheConfiguration']) && $this->isSecondLevelCacheEnabled()) { $this->_attributes['secondLevelCacheConfiguration'] = new CacheConfiguration(); } return $this->_attributes['secondLevelCacheConfiguration'] ?? null; } public function getDefaultQueryHints() { return $this->_attributes['defaultQueryHints'] ?? []; } public function setDefaultQueryHints(array $defaultQueryHints) { $this->_attributes['defaultQueryHints'] = $defaultQueryHints; } public function getDefaultQueryHint($name) { return $this->_attributes['defaultQueryHints'][$name] ?? \false; } public function setDefaultQueryHint($name, $value) { $this->_attributes['defaultQueryHints'][$name] = $value; } public function getSchemaIgnoreClasses() : array { return $this->_attributes['schemaIgnoreClasses'] ?? []; } public function setSchemaIgnoreClasses(array $schemaIgnoreClasses) : void { $this->_attributes['schemaIgnoreClasses'] = $schemaIgnoreClasses; } }