Doctrine


Doctrine\ORM\Configuration
/Doctrine/ORM/Configuration.php at line 37

Class Configuration

Class:Configuration - Superclass: Doctrine
Doctrine
⌊ Configuration

public class Configuration
extends Doctrine

Configuration container for all configuration options of Doctrine. It combines all configuration options from DBAL & ORM.

Since:
2.0
Internal:
When adding a new configuration option just write a getter/setter pair and add the option to the _attributes array with a proper default value.
Author:
Benjamin Eberlei
Guilherme Blanco
Jonathan Wage
Roman Borschel

Constructor Summary

Configuration()

Creates a new configuration that can be used for Doctrine.

Method Summary
void

addCustomDatetimeFunction(string name, string className)

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

void

addCustomNumericFunction(string name, string className)

Registers a custom DQL function that produces a numeric value.

void

addCustomStringFunction(string name, string className)

Registers a custom DQL function that produces a string value.

void

addEntityNamespace(string alias, string namespace)

Adds a namespace under a certain alias.

void

addNamedNativeQuery(string name, string sql, ResultSetMapping rsm)

Adds a named native query to the configuration.

void

addNamedQuery(string name, string dql)

Adds a named DQL query to the configuration.

void

ensureProductionSettings()

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

boolean

getAutoGenerateProxyClasses()

Gets a boolean flag that indicates whether proxy classes should always be regenerated during each script execution.

string

getCustomDatetimeFunction(string name)

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

string

getCustomNumericFunction(string name)

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

string

getCustomStringFunction(string name)

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

string

getEntityNamespace(string entityNamespaceAlias)

Resolves a registered namespace alias to the full namespace.

\Doctrine\Common\Cache\Cache

getMetadataCacheImpl()

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

Mapping\Driver\Driver

getMetadataDriverImpl()

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

array

getNamedNativeQuery(string name)

Gets the components of a previously registered named native query.

string

getNamedQuery(string name)

Gets a previously registered named DQL query.

string

getProxyDir()

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

string

getProxyNamespace()

Gets the namespace where proxy classes reside.

\Doctrine\Common\Cache\Cache

getQueryCacheImpl()

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

\Doctrine\Common\Cache\Cache

getResultCacheImpl()

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

boolean

getUseCExtension()

Gets a boolean flag that indicates whether Doctrine should make use of the C extension.

Mapping\Driver\AnnotationDriver

newDefaultAnnotationDriver(array paths)

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

void

setAutoGenerateProxyClasses(boolean bool)

Sets a boolean flag that indicates whether proxy classes should always be regenerated during each script execution.

void

setEntityNamespaces(mixed entityNamespaces, array entityAliasMap)

Set the entity alias map

void

setMetadataCacheImpl(\Doctrine\Common\Cache\Cache cacheImpl)

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

void

setMetadataDriverImpl(Driver driverImpl)

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

void

setProxyDir(string dir)

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

void

setProxyNamespace(string ns)

Sets the namespace where proxy classes reside.

void

setQueryCacheImpl(\Doctrine\Common\Cache\Cache cacheImpl)

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

void

setResultCacheImpl(\Doctrine\Common\Cache\Cache cacheImpl)

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

void

setUseCExtension(boolean boolean)

Sets a boolean flag that indicates whether Doctrine should make use of the C extension.

Constructor Detail

/Doctrine/ORM/Configuration.php at line 42

Configuration

public Configuration()

Creates a new configuration that can be used for Doctrine.


Method Detail

/Doctrine/ORM/Configuration.php at line 406

addCustomDatetimeFunction

public void addCustomDatetimeFunction(string name, string className)

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.


/Doctrine/ORM/Configuration.php at line 381

addCustomNumericFunction

public void addCustomNumericFunction(string name, string className)

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.


/Doctrine/ORM/Configuration.php at line 356

addCustomStringFunction

public void addCustomStringFunction(string name, string className)

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.


/Doctrine/ORM/Configuration.php at line 151

addEntityNamespace

public void addEntityNamespace(string alias, string namespace)

Adds a namespace under a certain alias.


/Doctrine/ORM/Configuration.php at line 308

addNamedNativeQuery

public void addNamedNativeQuery(string name, string sql, ResultSetMapping rsm)

Adds a named native query to the configuration.

Parameters:
name - The name of the query.
sql - The native SQL query string.
rsm - The ResultSetMapping used for the results of the SQL query.

/Doctrine/ORM/Configuration.php at line 282

addNamedQuery

public void addNamedQuery(string name, string dql)

Adds a named DQL query to the configuration.

Parameters:
name - The name of the query.
dql - The DQL query string.

/Doctrine/ORM/Configuration.php at line 335

ensureProductionSettings

public void ensureProductionSettings()

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

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

/Doctrine/ORM/Configuration.php at line 83

getAutoGenerateProxyClasses

public boolean getAutoGenerateProxyClasses()

Gets a boolean flag that indicates whether proxy classes should always be regenerated during each script execution.


/Doctrine/ORM/Configuration.php at line 417

getCustomDatetimeFunction

public string getCustomDatetimeFunction(string name)

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


/Doctrine/ORM/Configuration.php at line 392

getCustomNumericFunction

public string getCustomNumericFunction(string name)

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


/Doctrine/ORM/Configuration.php at line 367

getCustomStringFunction

public string getCustomStringFunction(string name)

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


/Doctrine/ORM/Configuration.php at line 163

getEntityNamespace

public string getEntityNamespace(string entityNamespaceAlias)

Resolves a registered namespace alias to the full namespace.

Throws:
MappingException

/Doctrine/ORM/Configuration.php at line 239

getMetadataCacheImpl

public \Doctrine\Common\Cache\Cache getMetadataCacheImpl()

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


/Doctrine/ORM/Configuration.php at line 189

getMetadataDriverImpl

public Mapping\Driver\Driver getMetadataDriverImpl()

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

Throws:
ORMException

/Doctrine/ORM/Configuration.php at line 320

getNamedNativeQuery

public array getNamedNativeQuery(string name)

Gets the components of a previously registered named native query.

Parameters:
name - The name of the query.
Returns:
A tuple with the first element being the SQL string and the second element being the ResultSetMapping.

/Doctrine/ORM/Configuration.php at line 293

getNamedQuery

public string getNamedQuery(string name)

Gets a previously registered named DQL query.

Parameters:
name - The name of the query.
Returns:
The DQL query.

/Doctrine/ORM/Configuration.php at line 72

getProxyDir

public string getProxyDir()

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


/Doctrine/ORM/Configuration.php at line 104

getProxyNamespace

public string getProxyNamespace()

Gets the namespace where proxy classes reside.


/Doctrine/ORM/Configuration.php at line 219

getQueryCacheImpl

public \Doctrine\Common\Cache\Cache getQueryCacheImpl()

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


/Doctrine/ORM/Configuration.php at line 199

getResultCacheImpl

public \Doctrine\Common\Cache\Cache getResultCacheImpl()

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


/Doctrine/ORM/Configuration.php at line 260

getUseCExtension

public boolean getUseCExtension()

Gets a boolean flag that indicates whether Doctrine should make use of the C extension.

Returns:
TRUE if Doctrine is configured to use the C extension, FALSE otherwise.

/Doctrine/ORM/Configuration.php at line 137

newDefaultAnnotationDriver

public Mapping\Driver\AnnotationDriver newDefaultAnnotationDriver(array paths)

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


/Doctrine/ORM/Configuration.php at line 94

setAutoGenerateProxyClasses

public void setAutoGenerateProxyClasses(boolean bool)

Sets a boolean flag that indicates whether proxy classes should always be regenerated during each script execution.


/Doctrine/ORM/Configuration.php at line 178

setEntityNamespaces

public void setEntityNamespaces(mixed entityNamespaces, array entityAliasMap)

Set the entity alias map


/Doctrine/ORM/Configuration.php at line 249

setMetadataCacheImpl

public void setMetadataCacheImpl(\Doctrine\Common\Cache\Cache cacheImpl)

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


/Doctrine/ORM/Configuration.php at line 126

setMetadataDriverImpl

public void setMetadataDriverImpl(Driver driverImpl)

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

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).

/Doctrine/ORM/Configuration.php at line 62

setProxyDir

public void setProxyDir(string dir)

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


/Doctrine/ORM/Configuration.php at line 114

setProxyNamespace

public void setProxyNamespace(string ns)

Sets the namespace where proxy classes reside.


/Doctrine/ORM/Configuration.php at line 229

setQueryCacheImpl

public void setQueryCacheImpl(\Doctrine\Common\Cache\Cache cacheImpl)

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


/Doctrine/ORM/Configuration.php at line 209

setResultCacheImpl

public void setResultCacheImpl(\Doctrine\Common\Cache\Cache cacheImpl)

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


/Doctrine/ORM/Configuration.php at line 271

setUseCExtension

public void setUseCExtension(boolean boolean)

Sets a boolean flag that indicates whether Doctrine should make use of the C extension.

Parameters:
boolean - Whether to make use of the C extension or not.

Doctrine