class Configuration extends Configuration (View source)

Configuration container for all configuration options of Doctrine.

It combines all configuration options from DBAL & ORM.

{@internal When adding a new configuration option just write a getter/setter pair. }}

Methods

setProxyDir(string $directory)

Sets the directory where Doctrine generates any necessary proxy class files.

setAutoGenerateProxyClasses(bool|int $autoGenerate)

Sets the strategy for automatically generating proxy classes.

setProxyNamespace(string $namespace)

Sets the namespace where proxy classes reside.

setMetadataDriverImpl(MappingDriver $metadataDriver)

Sets the cache driver implementation that is used for metadata caching.

newDefaultAnnotationDriver(array $paths = [])

Adds a new default annotation driver with a correctly configured annotation reader.

getMetadataDriverImpl()

Gets the cache driver implementation that is used for the mapping metadata.

getQueryCacheImpl()

Gets the cache driver implementation that is used for the query cache (SQL cache).

setQueryCacheImpl(Cache $queryCache)

Sets the cache driver implementation that is used for the query cache (SQL cache).

getHydrationCacheImpl()

Gets the cache driver implementation that is used for the hydration cache (SQL cache).

setHydrationCacheImpl(Cache $hydrationCache)

Sets the cache driver implementation that is used for the hydration cache (SQL cache).

getMetadataCacheImpl()

Gets the cache driver implementation that is used for metadata caching.

setMetadataCacheImpl(Cache $metadataCache)

Sets the cache driver implementation that is used for metadata caching.

ensureProductionSettings()

Ensures that this Configuration instance contains settings that are suitable for a production environment.

addCustomStringFunction(string $functionName, $classNameOrFactory)

Registers a custom DQL function that produces a string value.

string|callable|null
getCustomStringFunction(string $functionName)

Gets the implementation class name of a registered custom string DQL function.

setCustomStringFunctions(array $functions)

Sets a map of custom DQL string functions.

addCustomNumericFunction(string $functionName, $classNameOrFactory)

Registers a custom DQL function that produces a numeric value.

string|callable|null
getCustomNumericFunction(string $functionName)

Gets the implementation class name of a registered custom numeric DQL function.

setCustomNumericFunctions(array $functions)

Sets a map of custom DQL numeric functions.

addCustomDatetimeFunction(string $functionName, $classNameOrFactory)

Registers a custom DQL function that produces a date/time value.

string|callable|null
getCustomDatetimeFunction(string $functionName)

Gets the implementation class name of a registered custom date/time DQL function.

setCustomDatetimeFunctions(array $functions)

Sets a map of custom DQL date/time functions.

setCustomHydrationModes(iterable $modes)

Sets the custom hydrator modes in one pass.

string|null
getCustomHydrationMode(string $modeName)

Gets the hydrator class for the given hydration mode name.

addCustomHydrationMode(string $modeName, string $hydratorClassName)

Adds a custom hydration mode.

setClassMetadataFactoryName(string $classMetadataFactoryClassName)

Sets a class metadata factory.

getClassMetadataFactoryName()

No description

addFilter(string $filterName, string $filterClassName)

Adds a filter to the list of possible filters.

string|null
getFilterClassName(string $filterName)

Gets the class name for a given filter name.

setDefaultRepositoryClassName(string $repositoryClassName)

Sets default repository class.

getDefaultRepositoryClassName()

Get default repository class.

setNamingStrategy(NamingStrategy $namingStrategy)

Sets naming strategy.

getNamingStrategy()

Gets naming strategy.

setEntityListenerResolver(EntityListenerResolver $resolver)

Set the entity listener resolver.

getEntityListenerResolver()

Get the entity listener resolver.

setRepositoryFactory(RepositoryFactory $repositoryFactory)

Set the entity repository factory.

getRepositoryFactory()

Get the entity repository factory.

isSecondLevelCacheEnabled()

No description

setSecondLevelCacheEnabled(bool $flag = true)

No description

mixed[]
getDefaultQueryHints()

Returns query hints, which will be applied to every query in application

setDefaultQueryHints(array $defaultQueryHints)

Sets array of query hints, which will be applied to every query in application

mixed
getDefaultQueryHint(string $hintName)

Gets the value of a default query hint. If the hint name is not recognized, FALSE is returned.

setDefaultQueryHint(string $hintName, $value)

Sets a default query hint. If the hint name is not recognized, it is silently ignored.

buildGhostObjectFactory()

No description

getProxyManagerConfiguration()

No description

Details

setProxyDir(string $directory)

Sets the directory where Doctrine generates any necessary proxy class files.

Parameters

string $directory

setAutoGenerateProxyClasses(bool|int $autoGenerate)

Sets the strategy for automatically generating proxy classes.

Parameters

bool|int $autoGenerate Possible values are constants of Doctrine\ORM\Proxy\Factory\ProxyFactory. True is converted to AUTOGENERATE_ALWAYS, false to AUTOGENERATE_NEVER.

setProxyNamespace(string $namespace)

Sets the namespace where proxy classes reside.

Parameters

string $namespace

setMetadataDriverImpl(MappingDriver $metadataDriver)

Sets the cache driver implementation that is used for metadata caching.

Parameters

MappingDriver $metadataDriver

newDefaultAnnotationDriver(array $paths = [])

Adds a new default annotation driver with a correctly configured annotation reader.

Parameters

array $paths

getMetadataDriverImpl()

Gets the cache driver implementation that is used for the mapping metadata.

getQueryCacheImpl()

Gets the cache driver implementation that is used for the query cache (SQL cache).

setQueryCacheImpl(Cache $queryCache)

Sets the cache driver implementation that is used for the query cache (SQL cache).

Parameters

Cache $queryCache

getHydrationCacheImpl()

Gets the cache driver implementation that is used for the hydration cache (SQL cache).

setHydrationCacheImpl(Cache $hydrationCache)

Sets the cache driver implementation that is used for the hydration cache (SQL cache).

Parameters

Cache $hydrationCache

getMetadataCacheImpl()

Gets the cache driver implementation that is used for metadata caching.

setMetadataCacheImpl(Cache $metadataCache)

Sets the cache driver implementation that is used for metadata caching.

Parameters

Cache $metadataCache

ensureProductionSettings()

Ensures that this Configuration instance contains settings that are suitable for a production environment.

Exceptions

ORMException If a configuration setting has a value that is not suitable for a production environment.

addCustomStringFunction(string $functionName, $classNameOrFactory)

Registers a custom DQL function that produces a string value.

Such a function can then be used in any DQL statement in any place where string functions are allowed.

DQL function names are case-insensitive.

Parameters

string $functionName
$classNameOrFactory

string|callable|null getCustomStringFunction(string $functionName)

Gets the implementation class name of a registered custom string DQL function.

Parameters

string $functionName

Return Value

string|callable|null

setCustomStringFunctions(array $functions)

Sets a map of custom DQL string functions.

Keys must be function names and values the FQCN of the implementing class. The function names will be case-insensitive in DQL.

Any previously added string functions are discarded.

Parameters

array $functions The map of custom DQL string functions.

addCustomNumericFunction(string $functionName, $classNameOrFactory)

Registers a custom DQL function that produces a numeric value.

Such a function can then be used in any DQL statement in any place where numeric functions are allowed.

DQL function names are case-insensitive.

Parameters

string $functionName
$classNameOrFactory

string|callable|null getCustomNumericFunction(string $functionName)

Gets the implementation class name of a registered custom numeric DQL function.

Parameters

string $functionName

Return Value

string|callable|null

setCustomNumericFunctions(array $functions)

Sets a map of custom DQL numeric functions.

Keys must be function names and values the FQCN of the implementing class. The function names will be case-insensitive in DQL.

Any previously added numeric functions are discarded.

Parameters

array $functions The map of custom DQL numeric functions.

addCustomDatetimeFunction(string $functionName, $classNameOrFactory)

Registers a custom DQL function that produces a date/time value.

Such a function can then be used in any DQL statement in any place where date/time functions are allowed.

DQL function names are case-insensitive.

Parameters

string $functionName
$classNameOrFactory

string|callable|null getCustomDatetimeFunction(string $functionName)

Gets the implementation class name of a registered custom date/time DQL function.

Parameters

string $functionName

Return Value

string|callable|null

setCustomDatetimeFunctions(array $functions)

Sets a map of custom DQL date/time functions.

Keys must be function names and values the FQCN of the implementing class. The function names will be case-insensitive in DQL.

Any previously added date/time functions are discarded.

Parameters

array $functions The map of custom DQL date/time functions.

setCustomHydrationModes(iterable $modes)

Sets the custom hydrator modes in one pass.

Parameters

iterable $modes An iterable of string $modeName => string $hydratorClassName

string|null getCustomHydrationMode(string $modeName)

Gets the hydrator class for the given hydration mode name.

Parameters

string $modeName

Return Value

string|null The hydrator class name.

addCustomHydrationMode(string $modeName, string $hydratorClassName)

Adds a custom hydration mode.

Parameters

string $modeName
string $hydratorClassName

setClassMetadataFactoryName(string $classMetadataFactoryClassName)

Sets a class metadata factory.

Parameters

string $classMetadataFactoryClassName

getClassMetadataFactoryName()

addFilter(string $filterName, string $filterClassName)

Adds a filter to the list of possible filters.

Parameters

string $filterName
string $filterClassName

string|null getFilterClassName(string $filterName)

Gets the class name for a given filter name.

Parameters

string $filterName

Return Value

string|null The class name of the filter

setDefaultRepositoryClassName(string $repositoryClassName)

Sets default repository class.

Parameters

string $repositoryClassName

Exceptions

ORMException If not is a \Doctrine\Common\Persistence\ObjectRepository implementation.

getDefaultRepositoryClassName()

Get default repository class.

setNamingStrategy(NamingStrategy $namingStrategy)

Sets naming strategy.

Parameters

NamingStrategy $namingStrategy

getNamingStrategy()

Gets naming strategy.

.

setEntityListenerResolver(EntityListenerResolver $resolver)

Set the entity listener resolver.

Parameters

EntityListenerResolver $resolver

getEntityListenerResolver()

Get the entity listener resolver.

setRepositoryFactory(RepositoryFactory $repositoryFactory)

Set the entity repository factory.

Parameters

RepositoryFactory $repositoryFactory

getRepositoryFactory()

Get the entity repository factory.

isSecondLevelCacheEnabled()

setSecondLevelCacheEnabled(bool $flag = true)

Parameters

bool $flag

setSecondLevelCacheConfiguration(CacheConfiguration $cacheConfig)

Parameters

CacheConfiguration $cacheConfig

getSecondLevelCacheConfiguration()

mixed[] getDefaultQueryHints()

Returns query hints, which will be applied to every query in application

Return Value

mixed[]

setDefaultQueryHints(array $defaultQueryHints)

Sets array of query hints, which will be applied to every query in application

Parameters

array $defaultQueryHints

mixed getDefaultQueryHint(string $hintName)

Gets the value of a default query hint. If the hint name is not recognized, FALSE is returned.

Parameters

string $hintName

Return Value

mixed The value of the hint or FALSE, if the hint name is not recognized.

setDefaultQueryHint(string $hintName, $value)

Sets a default query hint. If the hint name is not recognized, it is silently ignored.

Parameters

string $hintName
$value

buildGhostObjectFactory()

getProxyManagerConfiguration()