class Configuration (View source)

Configuration class for the DocumentManager. When setting up your DocumentManager you can optionally specify an instance of this class as the second argument.

If you do not pass a configuration object, a blank one will be created for you.

<?php

$config = new Configuration();
$dm = DocumentManager::create(new Connection(), $config);

Constants

AUTOGENERATE_NEVER

Never autogenerate a proxy/hydrator/persistent collection and rely that it was generated by some process before deployment. Copied from \Doctrine\Common\Proxy\AbstractProxyFactory.

AUTOGENERATE_ALWAYS

Always generates a new proxy/hydrator/persistent collection in every request.

This is only sane during development. Copied from \Doctrine\Common\Proxy\AbstractProxyFactory.

AUTOGENERATE_FILE_NOT_EXISTS

Autogenerate the proxy/hydrator/persistent collection class when the file does not exist.

This strategy causes a file exists call whenever any proxy/hydrator is used the first time in a request. Copied from \Doctrine\Common\Proxy\AbstractProxyFactory.

AUTOGENERATE_EVAL

Generate the proxy/hydrator/persistent collection classes using eval().

This strategy is only sane for development. Copied from \Doctrine\Common\Proxy\AbstractProxyFactory.

Methods

__construct()

No description

addDocumentNamespace(string $alias, string $namespace)

Adds a namespace under a certain alias.

getDocumentNamespace(string $documentNamespaceAlias)

Resolves a registered namespace alias to the full namespace.

getDocumentNamespaces()

Retrieves the list of registered document namespace aliases.

setDocumentNamespaces(array $documentNamespaces)

Set the document alias map

setMetadataDriverImpl(MappingDriver $driverImpl)

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

newDefaultAnnotationDriver(array $paths = [])

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

getMetadataDriverImpl()

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

getMetadataCacheImpl()

No description

setMetadataCacheImpl(Cache $cacheImpl)

No description

setProxyDir(string $dir)

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

getProxyDir()

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

getAutoGenerateProxyClasses()

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

setAutoGenerateProxyClasses(int $mode)

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

getProxyNamespace()

No description

setProxyNamespace(string $ns)

No description

setHydratorDir(string $dir)

No description

getHydratorDir()

No description

getAutoGenerateHydratorClasses()

Gets an int flag that indicates whether hydrator classes should always be regenerated during each script execution.

setAutoGenerateHydratorClasses(int $mode)

Sets an int flag that indicates whether hydrator classes should always be regenerated during each script execution.

getHydratorNamespace()

No description

setHydratorNamespace(string $ns)

No description

setPersistentCollectionDir(string $dir)

No description

getPersistentCollectionDir()

No description

getAutoGeneratePersistentCollectionClasses()

Gets a integer flag that indicates how and when persistent collection classes should be generated.

setAutoGeneratePersistentCollectionClasses(int $mode)

Sets a integer flag that indicates how and when persistent collection classes should be generated.

setPersistentCollectionNamespace(string $ns)

No description

setDefaultDB(string $defaultDB)

Sets the default DB to use for all Documents that do not specify a database.

getDefaultDB()

Gets the default DB to use for all Documents that do not specify a database.

setClassMetadataFactoryName(string $cmfName)

No description

getClassMetadataFactoryName()

No description

getDefaultCommitOptions()

No description

setDefaultCommitOptions(array $defaultCommitOptions)

No description

addFilter(string $name, string $className, array $parameters = [])

Add a filter to the list of possible filters.

getFilterClassName(string $name)

No description

getFilterParameters(string $name)

No description

setDefaultDocumentRepositoryClassName(string $className)

No description

setDefaultGridFSRepositoryClassName(string $className)

No description

setRepositoryFactory(RepositoryFactory $repositoryFactory)

No description

getRepositoryFactory()

No description

setPersistentCollectionFactory(PersistentCollectionFactory $persistentCollectionFactory)

No description

setPersistentCollectionGenerator(PersistentCollectionGenerator $persistentCollectionGenerator)

No description

buildGhostObjectFactory()

No description

getProxyManagerConfiguration()

No description

Details

__construct()

addDocumentNamespace(string $alias, string $namespace)

Adds a namespace under a certain alias.

Parameters

string $alias
string $namespace

getDocumentNamespace(string $documentNamespaceAlias)

Resolves a registered namespace alias to the full namespace.

Parameters

string $documentNamespaceAlias

Exceptions

MongoDBException

getDocumentNamespaces()

Retrieves the list of registered document namespace aliases.

setDocumentNamespaces(array $documentNamespaces)

Set the document alias map

Parameters

array $documentNamespaces

setMetadataDriverImpl(MappingDriver $driverImpl)

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

Parameters

MappingDriver $driverImpl

newDefaultAnnotationDriver(array $paths = [])

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

getMetadataCacheImpl()

setMetadataCacheImpl(Cache $cacheImpl)

Parameters

Cache $cacheImpl

setProxyDir(string $dir)

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

Parameters

string $dir

getProxyDir()

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

getAutoGenerateProxyClasses()

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

setAutoGenerateProxyClasses(int $mode)

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

Parameters

int $mode

Exceptions

InvalidArgumentException If an invalid mode was given.

getProxyNamespace()

setProxyNamespace(string $ns)

Parameters

string $ns

setHydratorDir(string $dir)

Parameters

string $dir

getHydratorDir()

getAutoGenerateHydratorClasses()

Gets an int flag that indicates whether hydrator classes should always be regenerated during each script execution.

setAutoGenerateHydratorClasses(int $mode)

Sets an int flag that indicates whether hydrator classes should always be regenerated during each script execution.

Parameters

int $mode

getHydratorNamespace()

setHydratorNamespace(string $ns)

Parameters

string $ns

setPersistentCollectionDir(string $dir)

Parameters

string $dir

getPersistentCollectionDir()

getAutoGeneratePersistentCollectionClasses()

Gets a integer flag that indicates how and when persistent collection classes should be generated.

setAutoGeneratePersistentCollectionClasses(int $mode)

Sets a integer flag that indicates how and when persistent collection classes should be generated.

Parameters

int $mode

getPersistentCollectionNamespace()

setPersistentCollectionNamespace(string $ns)

Parameters

string $ns

setDefaultDB(string $defaultDB)

Sets the default DB to use for all Documents that do not specify a database.

Parameters

string $defaultDB

getDefaultDB()

Gets the default DB to use for all Documents that do not specify a database.

setClassMetadataFactoryName(string $cmfName)

Parameters

string $cmfName

getClassMetadataFactoryName()

getDefaultCommitOptions()

setDefaultCommitOptions(array $defaultCommitOptions)

Parameters

array $defaultCommitOptions

addFilter(string $name, string $className, array $parameters = [])

Add a filter to the list of possible filters.

Parameters

string $name
string $className
array $parameters

getFilterClassName(string $name)

Parameters

string $name

getFilterParameters(string $name)

Parameters

string $name

setDefaultDocumentRepositoryClassName(string $className)

Parameters

string $className

Exceptions

MongoDBException If not is a ObjectRepository.

getDefaultDocumentRepositoryClassName()

setDefaultGridFSRepositoryClassName(string $className)

Parameters

string $className

Exceptions

MongoDBException If the class does not implement the GridFSRepository interface.

getDefaultGridFSRepositoryClassName()

setRepositoryFactory(RepositoryFactory $repositoryFactory)

Parameters

RepositoryFactory $repositoryFactory

getRepositoryFactory()

setPersistentCollectionFactory(PersistentCollectionFactory $persistentCollectionFactory)

Parameters

PersistentCollectionFactory $persistentCollectionFactory

getPersistentCollectionFactory()

setPersistentCollectionGenerator(PersistentCollectionGenerator $persistentCollectionGenerator)

Parameters

PersistentCollectionGenerator $persistentCollectionGenerator

getPersistentCollectionGenerator()

buildGhostObjectFactory()

getProxyManagerConfiguration()