AbstractDoctrineExtension
abstract class AbstractDoctrineExtension extends Extension
This abstract classes groups common code that Doctrine Object Manager extensions (ORM, MongoDB, CouchDB) need.
Properties
protected | $aliasMap | Used inside metadata driver method to simplify aggregation of data. | |
protected | $drivers | Used inside metadata driver method to simplify aggregation of data. |
Methods
Returns the namespace to be used for this extension (XML namespace).
Adds annotated classes to the class cache.
Register the alias for this mapping driver.
Register the mapping driver configuration for later use with the object managers metadata driver chain.
If this is a bundle controlled mapping all the missing information can be autodetected by this method.
Register all the collected mapping information with the object manager by registering the appropriate mapping drivers.
Assertion if the specified mapping information is valid.
Detects what metadata driver to use for the supplied directory.
Loads a configured object manager metadata, query or result cache driver.
Loads a cache driver.
Returns a modified version of $managerConfigs.
Prefixes the relative dependency injection container path with the object manager prefix.
Noun that describes the mapped objects such as Entity or Document.
Relative path from the bundle root to the directory where mapping files reside.
Extension used by the mapping files.
Details
string
getAlias()
Returns the recommended alias to use in XML.
This alias is also the mandatory prefix to use when using YAML.
This convention is to remove the "Extension" postfix from the class name and then lowercase and underscore the result. So:
AcmeHelloExtension
becomes
acme_hello
This can be overridden in a sub-class to specify the alias manually.
ConfigurationInterface|null
getConfiguration(array $config, ContainerBuilder $container)
Returns extension configuration.
protected
setMappingDriverAlias(array $mappingConfig, string $mappingName)
Register the alias for this mapping driver.
Aliases can be used in the Query languages of all the Doctrine object managers to simplify writing tasks.
protected
setMappingDriverConfig(array $mappingConfig, string $mappingName)
Register the mapping driver configuration for later use with the object managers metadata driver chain.
protected array|false
getMappingDriverBundleConfigDefaults(array $bundleConfig, ReflectionClass $bundle, ContainerBuilder $container)
If this is a bundle controlled mapping all the missing information can be autodetected by this method.
Returns false when autodetection failed, an array of the completed information otherwise.
protected
registerMappingDrivers(array $objectManager, ContainerBuilder $container)
Register all the collected mapping information with the object manager by registering the appropriate mapping drivers.
protected
assertValidMappingConfiguration(array $mappingConfig, string $objectManagerName)
Assertion if the specified mapping information is valid.
protected string|null
detectMetadataDriver(string $dir, ContainerBuilder $container)
Detects what metadata driver to use for the supplied directory.
protected
loadObjectManagerCacheDriver(array $objectManager, ContainerBuilder $container, string $cacheName)
Loads a configured object manager metadata, query or result cache driver.
protected string
loadCacheDriver(string $cacheName, string $objectManagerName, array $cacheDriver, ContainerBuilder $container)
Loads a cache driver.
protected array
fixManagersAutoMappings(array $managerConfigs, array $bundles)
Returns a modified version of $managerConfigs.
The manager called $autoMappedManager will map all bundles that are not mapped by other managers.
abstract protected string
getObjectManagerElementName(string $name)
Prefixes the relative dependency injection container path with the object manager prefix.
abstract protected string
getMappingObjectDefaultName()
Noun that describes the mapped objects such as Entity or Document.
Will be used for autodetection of persistent objects directory.