mediatekformation

Configuration extends Configuration
in package

Configuration container for all configuration options of Doctrine.

It combines all configuration options from DBAL & ORM.

Internal note: When adding a new configuration option just write a getter/setter pair.

Table of Contents

$_attributes  : array<string|int, mixed>
$autoCommit  : bool
The default auto-commit mode for connections.
$resultCacheImpl  : Cache|null
The cache driver implementation that is used for query result caching.
$schemaAssetsFilter  : callable|null
The callable to use to filter schema assets.
$sqlLogger  : SQLLogger|null
The SQL logger in use. If null, SQL logging is disabled.
$middlewares  : array<string|int, Middleware>
$resultCache  : CacheItemPoolInterface|null
The cache driver implementation that is used for query result caching.
addCustomDatetimeFunction()  : void
Registers a custom DQL function that produces a date/time value.
addCustomHydrationMode()  : void
Adds a custom hydration mode.
addCustomNumericFunction()  : void
Registers a custom DQL function that produces a numeric value.
addCustomStringFunction()  : void
Registers a custom DQL function that produces a string value.
addEntityNamespace()  : void
Adds a namespace under a certain alias.
addFilter()  : void
Adds a filter to the list of possible filters.
addNamedNativeQuery()  : void
Adds a named native query to the configuration.
addNamedQuery()  : void
Adds a named DQL query to the configuration.
ensureProductionSettings()  : void
Ensures that this Configuration instance contains settings that are suitable for a production environment.
getAutoCommit()  : bool
Returns the default auto-commit mode for connections.
getAutoGenerateProxyClasses()  : int
Gets the strategy for automatically generating proxy classes.
getClassMetadataFactoryName()  : string
getCustomDatetimeFunction()  : string|null
Gets the implementation class name of a registered custom date/time DQL function.
getCustomHydrationMode()  : string|null
Gets the hydrator class for the given hydration mode name.
getCustomNumericFunction()  : string|null
Gets the implementation class name of a registered custom numeric DQL function.
getCustomStringFunction()  : string|null
Gets the implementation class name of a registered custom string DQL function.
getDefaultQueryHint()  : mixed
Gets the value of a default query hint. If the hint name is not recognized, FALSE is returned.
getDefaultQueryHints()  : mixed
Returns query hints, which will be applied to every query in application
getDefaultRepositoryClassName()  : string
Get default repository class.
getEntityListenerResolver()  : EntityListenerResolver
Get the entity listener resolver.
getEntityNamespace()  : string
Resolves a registered namespace alias to the full namespace.
getEntityNamespaces()  : mixed
Retrieves the list of registered entity namespace aliases.
getFilterClassName()  : string|null
Gets the class name for a given filter name.
getHydrationCache()  : CacheItemPoolInterface|null
getHydrationCacheImpl()  : Cache|null
Gets the cache driver implementation that is used for the hydration cache (SQL cache).
getMetadataCache()  : CacheItemPoolInterface|null
getMetadataCacheImpl()  : Cache|null
Gets the cache driver implementation that is used for metadata caching.
getMetadataDriverImpl()  : MappingDriver|null
Gets the cache driver implementation that is used for the mapping metadata.
getMiddlewares()  : array<string|int, Middleware>
getNamedNativeQuery()  : array<string|int, mixed>
Gets the components of a previously registered named native query.
getNamedQuery()  : string
Gets a previously registered named DQL query.
getNamingStrategy()  : NamingStrategy
Gets naming strategy.
getProxyDir()  : string|null
Gets the directory where Doctrine generates any necessary proxy class files.
getProxyNamespace()  : string|null
Gets the namespace where proxy classes reside.
getQueryCache()  : CacheItemPoolInterface|null
Gets the cache driver implementation that is used for the query cache (SQL cache).
getQueryCacheImpl()  : Cache|null
Gets the cache driver implementation that is used for the query cache (SQL cache).
getQuoteStrategy()  : QuoteStrategy
Gets quote strategy.
getRepositoryFactory()  : RepositoryFactory
Get the entity repository factory.
getResultCache()  : CacheItemPoolInterface|null
Gets the cache driver implementation that is used for query result caching.
getResultCacheImpl()  : Cache|null
Gets the cache driver implementation that is used for query result caching.
getSchemaAssetsFilter()  : callable|null
Returns the callable to use to filter schema assets.
getSecondLevelCacheConfiguration()  : CacheConfiguration|null
getSQLLogger()  : SQLLogger|null
Gets the SQL logger that is used.
isSecondLevelCacheEnabled()  : bool
newDefaultAnnotationDriver()  : AnnotationDriver
Adds a new default annotation driver with a correctly configured annotation reader. If $useSimpleAnnotationReader is true, the notation `@Entity` will work, otherwise, the notation `@ORM\Entity` will be supported.
setAutoCommit()  : void
Sets the default auto-commit mode for connections.
setAutoGenerateProxyClasses()  : void
Sets the strategy for automatically generating proxy classes.
setClassMetadataFactoryName()  : void
Sets a class metadata factory.
setCustomDatetimeFunctions()  : void
Sets a map of custom DQL date/time functions.
setCustomHydrationModes()  : void
Sets the custom hydrator modes in one pass.
setCustomNumericFunctions()  : void
Sets a map of custom DQL numeric functions.
setCustomStringFunctions()  : void
Sets a map of custom DQL string functions.
setDefaultQueryHint()  : void
Sets a default query hint. If the hint name is not recognized, it is silently ignored.
setDefaultQueryHints()  : void
Sets array of query hints, which will be applied to every query in application
setDefaultRepositoryClassName()  : void
Sets default repository class.
setEntityListenerResolver()  : void
Set the entity listener resolver.
setEntityNamespaces()  : void
Sets the entity alias map.
setHydrationCache()  : void
setHydrationCacheImpl()  : void
Sets the cache driver implementation that is used for the hydration cache (SQL cache).
setMetadataCache()  : void
setMetadataCacheImpl()  : void
Sets the cache driver implementation that is used for metadata caching.
setMetadataDriverImpl()  : void
Sets the cache driver implementation that is used for metadata caching.
setMiddlewares()  : $this
setNamingStrategy()  : void
Sets naming strategy.
setProxyDir()  : void
Sets the directory where Doctrine generates any necessary proxy class files.
setProxyNamespace()  : void
Sets the namespace where proxy classes reside.
setQueryCache()  : void
Sets the cache driver implementation that is used for the query cache (SQL cache).
setQueryCacheImpl()  : void
Sets the cache driver implementation that is used for the query cache (SQL cache).
setQuoteStrategy()  : void
Sets quote strategy.
setRepositoryFactory()  : void
Set the entity repository factory.
setResultCache()  : void
Sets the cache driver implementation that is used for query result caching.
setResultCacheImpl()  : void
Sets the cache driver implementation that is used for query result caching.
setSchemaAssetsFilter()  : void
Sets the callable to use to filter schema assets.
setSecondLevelCacheConfiguration()  : void
setSecondLevelCacheEnabled()  : void
setSQLLogger()  : void
Sets the SQL logger to use. Defaults to NULL which means SQL logging is disabled.

Properties

$_attributes

protected array<string|int, mixed> $_attributes = []

$autoCommit

The default auto-commit mode for connections.

protected bool $autoCommit = true

$resultCacheImpl

The cache driver implementation that is used for query result caching.

protected Cache|null $resultCacheImpl
Tags
deprecated

Use $resultCache instead.

$schemaAssetsFilter

The callable to use to filter schema assets.

protected callable|null $schemaAssetsFilter

Methods

addCustomDatetimeFunction()

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

public addCustomDatetimeFunction(string $name, string|callable $className) : void

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
$name : string

Function name.

$className : string|callable

Class name or a callable that returns the function.

Tags
psalm-param

class-string|callable $className

Return values
void —

addCustomHydrationMode()

Adds a custom hydration mode.

public addCustomHydrationMode(string $modeName, string $hydrator) : void
Parameters
$modeName : string

The hydration mode name.

$hydrator : string

The hydrator class name.

Tags
psalm-param

class-string $hydrator

Return values
void —

addCustomNumericFunction()

Registers a custom DQL function that produces a numeric value.

public addCustomNumericFunction(string $name, string|callable $className) : void

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
$name : string

Function name.

$className : string|callable

Class name or a callable that returns the function.

Return values
void —

addCustomStringFunction()

Registers a custom DQL function that produces a string value.

public addCustomStringFunction(string $name, string|callable $className) : void

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
$name : string

Function name.

$className : string|callable

Class name or a callable that returns the function.

Return values
void —

addEntityNamespace()

Adds a namespace under a certain alias.

public addEntityNamespace(string $alias, string $namespace) : void
Parameters
$alias : string
$namespace : string
Return values
void —

addFilter()

Adds a filter to the list of possible filters.

public addFilter(string $name, string $className) : void
Parameters
$name : string

The name of the filter.

$className : string

The class name of the filter.

Return values
void —

addNamedNativeQuery()

Adds a named native query to the configuration.

public addNamedNativeQuery(string $name, string $sql, ResultSetMapping $rsm) : void
Parameters
$name : string

The name of the query.

$sql : string

The native SQL query string.

$rsm : ResultSetMapping

The ResultSetMapping used for the results of the SQL query.

Return values
void —

addNamedQuery()

Adds a named DQL query to the configuration.

public addNamedQuery(string $name, string $dql) : void
Parameters
$name : string

The name of the query.

$dql : string

The DQL query string.

Return values
void —

ensureProductionSettings()

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

public ensureProductionSettings() : void
Tags
throws
ProxyClassesAlwaysRegenerating
throws
CacheException

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

Return values
void —

getAutoCommit()

Returns the default auto-commit mode for connections.

public getAutoCommit() : bool
Tags
see
setAutoCommit
Return values
bool —

True if auto-commit mode is enabled by default for connections, false otherwise.

getAutoGenerateProxyClasses()

Gets the strategy for automatically generating proxy classes.

public getAutoGenerateProxyClasses() : int
Tags
deprecated
2.7

We're switch to ocramius/proxy-manager and this method isn't applicable any longer

see
https://github.com/Ocramius/ProxyManager
Return values
int —

Possible values are constants of Doctrine\Common\Proxy\AbstractProxyFactory.

getClassMetadataFactoryName()

public getClassMetadataFactoryName() : string
Tags
psalm-return

class-string

Return values
string —

getCustomDatetimeFunction()

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

public getCustomDatetimeFunction(string $name) : string|null
Parameters
$name : string
Tags
psalm-return

?class-string $name

Return values
string|null —

getCustomHydrationMode()

Gets the hydrator class for the given hydration mode name.

public getCustomHydrationMode(string $modeName) : string|null
Parameters
$modeName : string

The hydration mode name.

Tags
psalm-return

?class-string

Return values
string|null —

The hydrator class name.

getCustomNumericFunction()

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

public getCustomNumericFunction(string $name) : string|null
Parameters
$name : string
Tags
psalm-return

?class-string

Return values
string|null —

getCustomStringFunction()

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

public getCustomStringFunction(string $name) : string|null
Parameters
$name : string
Tags
psalm-return

?class-string

Return values
string|null —

getDefaultQueryHint()

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

public getDefaultQueryHint(string $name) : mixed
Parameters
$name : string

The name of the hint.

Return values
mixed —

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

getDefaultQueryHints()

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

public getDefaultQueryHints() : mixed
Tags
psalm-return

array<string, mixed>

Return values
mixed —

getDefaultRepositoryClassName()

Get default repository class.

public getDefaultRepositoryClassName() : string
Tags
psalm-return

class-string

Return values
string —

getEntityNamespace()

Resolves a registered namespace alias to the full namespace.

public getEntityNamespace(string $entityNamespaceAlias) : string
Parameters
$entityNamespaceAlias : string
Tags
throws
UnknownEntityNamespace
Return values
string —

getEntityNamespaces()

Retrieves the list of registered entity namespace aliases.

public getEntityNamespaces() : mixed
Tags
psalm-return

array<string, string>

Return values
mixed —

getFilterClassName()

Gets the class name for a given filter name.

public getFilterClassName(string $name) : string|null
Parameters
$name : string

The name of the filter.

Tags
psalm-return

?class-string

Return values
string|null —

The class name of the filter, or null if it is not defined.

getHydrationCacheImpl()

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

public getHydrationCacheImpl() : Cache|null
Tags
deprecated

Call getHydrationCache() instead.

Return values
Cache|null —

getMetadataCacheImpl()

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

public getMetadataCacheImpl() : Cache|null
Tags
deprecated

Deprecated in favor of getMetadataCache

Return values
Cache|null —

getNamedNativeQuery()

Gets the components of a previously registered named native query.

public getNamedNativeQuery(string $name) : array<string|int, mixed>
Parameters
$name : string

The name of the query.

Tags
psalm-return

array{string, ResultSetMapping} A tuple with the first element being the SQL string and the second element being the ResultSetMapping.

throws
NamedNativeQueryNotFound
Return values
array<string|int, mixed> —

getNamedQuery()

Gets a previously registered named DQL query.

public getNamedQuery(string $name) : string
Parameters
$name : string

The name of the query.

Tags
throws
NamedQueryNotFound
Return values
string —

The DQL query.

getProxyDir()

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

public getProxyDir() : string|null
Tags
deprecated
2.7

We're switch to ocramius/proxy-manager and this method isn't applicable any longer

see
https://github.com/Ocramius/ProxyManager
Return values
string|null —

getProxyNamespace()

Gets the namespace where proxy classes reside.

public getProxyNamespace() : string|null
Tags
deprecated
2.7

We're switch to ocramius/proxy-manager and this method isn't applicable any longer

see
https://github.com/Ocramius/ProxyManager
Return values
string|null —

getQueryCacheImpl()

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

public getQueryCacheImpl() : Cache|null
Tags
deprecated

Call getQueryCache() instead.

Return values
Cache|null —

getResultCacheImpl()

Gets the cache driver implementation that is used for query result caching.

public getResultCacheImpl() : Cache|null
Tags
deprecated

Use getResultCache() instead.

Return values
Cache|null —

getSchemaAssetsFilter()

Returns the callable to use to filter schema assets.

public getSchemaAssetsFilter() : callable|null
Return values
callable|null —

isSecondLevelCacheEnabled()

public isSecondLevelCacheEnabled() : bool
Return values
bool —

newDefaultAnnotationDriver()

Adds a new default annotation driver with a correctly configured annotation reader. If $useSimpleAnnotationReader is true, the notation `@Entity` will work, otherwise, the notation `@ORM\Entity` will be supported.

public newDefaultAnnotationDriver([string|array<string|int, string> $paths = [] ][, bool $useSimpleAnnotationReader = true ]) : AnnotationDriver
Parameters
$paths : string|array<string|int, string> = []
$useSimpleAnnotationReader : bool = true
Tags
psalm-param

string|list $paths

Return values
AnnotationDriver —

setAutoCommit()

Sets the default auto-commit mode for connections.

public setAutoCommit(bool $autoCommit) : void

If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback. By default, new connections are in auto-commit mode.

Parameters
$autoCommit : bool

True to enable auto-commit mode; false to disable it

Tags
see
getAutoCommit
Return values
void —

setAutoGenerateProxyClasses()

Sets the strategy for automatically generating proxy classes.

public setAutoGenerateProxyClasses(bool|int $autoGenerate) : void
Parameters
$autoGenerate : bool|int

Possible values are constants of Doctrine\Common\Proxy\AbstractProxyFactory. True is converted to AUTOGENERATE_ALWAYS, false to AUTOGENERATE_NEVER.

Return values
void —

setClassMetadataFactoryName()

Sets a class metadata factory.

public setClassMetadataFactoryName(string $cmfName) : void
Parameters
$cmfName : string
Tags
psalm-param

class-string $cmfName

Return values
void —

setCustomDatetimeFunctions()

Sets a map of custom DQL date/time functions.

public setCustomDatetimeFunctions(array<string|int, mixed> $functions) : void

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
$functions : array<string|int, mixed>

The map of custom DQL date/time functions.

Tags
psalm-param

array<string, string> $functions

Return values
void —

setCustomHydrationModes()

Sets the custom hydrator modes in one pass.

public setCustomHydrationModes(array<string, class-string> $modes) : void
Parameters
$modes : array<string, class-string>

An array of ($modeName => $hydrator).

Return values
void —

setCustomNumericFunctions()

Sets a map of custom DQL numeric functions.

public setCustomNumericFunctions(array<string|int, mixed> $functions) : void

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
$functions : array<string|int, mixed>
Tags
psalm-param

array<string, class-string> $functions The map of custom DQL numeric functions.

Return values
void —

setCustomStringFunctions()

Sets a map of custom DQL string functions.

public setCustomStringFunctions(array<string|int, mixed> $functions) : void

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
$functions : array<string|int, mixed>
Tags
psalm-param

array<string, class-string> $functions The map of custom DQL string functions.

Return values
void —

setDefaultQueryHint()

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

public setDefaultQueryHint(string $name, mixed $value) : void
Parameters
$name : string

The name of the hint.

$value : mixed

The value of the hint.

Return values
void —

setDefaultQueryHints()

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

public setDefaultQueryHints(array<string|int, mixed> $defaultQueryHints) : void
Parameters
$defaultQueryHints : array<string|int, mixed>
Tags
psalm-param

array<string, mixed> $defaultQueryHints

Return values
void —

setDefaultRepositoryClassName()

Sets default repository class.

public setDefaultRepositoryClassName(string $className) : void
Parameters
$className : string
Tags
throws
InvalidEntityRepository

If $classname is not an ObjectRepository.

Return values
void —

setEntityNamespaces()

Sets the entity alias map.

public setEntityNamespaces(array<string|int, mixed> $entityNamespaces) : void
Parameters
$entityNamespaces : array<string|int, mixed>
Tags
psalm-param

array<string, string> $entityNamespaces

Return values
void —

setHydrationCacheImpl()

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

public setHydrationCacheImpl(Cache $cacheImpl) : void
Parameters
$cacheImpl : Cache
Tags
deprecated

Call setHydrationCache() instead.

Return values
void —

setMetadataCacheImpl()

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

public setMetadataCacheImpl(Cache $cacheImpl) : void
Parameters
$cacheImpl : Cache
Tags
deprecated

Deprecated in favor of setMetadataCache

Return values
void —

setMetadataDriverImpl()

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

public setMetadataDriverImpl(MappingDriver $driverImpl) : void
Parameters
$driverImpl : MappingDriver
Tags
todo

Force parameter to be a Closure to ensure lazy evaluation (as soon as a metadata cache is in effect, the driver never needs to initialize).

Return values
void —

setMiddlewares()

public setMiddlewares(array<string|int, Middleware> $middlewares) : $this
Parameters
$middlewares : array<string|int, Middleware>
Return values
$this —

setProxyDir()

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

public setProxyDir(string $dir) : void
Parameters
$dir : string
Return values
void —

setProxyNamespace()

Sets the namespace where proxy classes reside.

public setProxyNamespace(string $ns) : void
Parameters
$ns : string
Return values
void —

setQueryCacheImpl()

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

public setQueryCacheImpl(Cache $cacheImpl) : void
Parameters
$cacheImpl : Cache
Tags
deprecated

Call setQueryCache() instead.

Return values
void —

setResultCacheImpl()

Sets the cache driver implementation that is used for query result caching.

public setResultCacheImpl(Cache $cacheImpl) : void
Parameters
$cacheImpl : Cache
Tags
deprecated

Use setResultCache() instead.

Return values
void —

setSchemaAssetsFilter()

Sets the callable to use to filter schema assets.

public setSchemaAssetsFilter([callable|null $callable = null ]) : void
Parameters
$callable : callable|null = null
Return values
void —

setSecondLevelCacheEnabled()

public setSecondLevelCacheEnabled([bool $flag = true ]) : void
Parameters
$flag : bool = true
Return values
void —

setSQLLogger()

Sets the SQL logger to use. Defaults to NULL which means SQL logging is disabled.

public setSQLLogger([SQLLogger|null $logger = null ]) : void
Parameters
$logger : SQLLogger|null = null
Return values
void —

Search results