PHP Class Symfony\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension

Author: Jonathan H. Wage ([email protected])
Author: Fabien Potencier ([email protected])
Inheritance: extends Symfony\Component\DependencyInjection\Extension\Extension
Mostra file Open project: pmjones/php-framework-benchmarks Class Usage Examples

Public Methods

Method Description
dbalLoad ( array $config, ContainerBuilder $container ) Loads the DBAL configuration.
getAlias ( ) : string Returns the recommended alias to use in XML.
getNamespace ( ) : string Returns the namespace to be used for this extension (XML namespace).
getXsdValidationBasePath ( ) : string Returns the base path for the XSD files.
load ( array $configs, ContainerBuilder $container )
ormLoad ( array $config, ContainerBuilder $container ) Loads the Doctrine ORM configuration.

Protected Methods

Method Description
createOrmProxyDirectory ( $tmpDir ) Create the Doctrine ORM Entity proxy directory
detectMetadataDriver ( string $dir, ContainerBuilder $container ) : string | null Detects what metadata driver to use for the supplied directory.
findBundleSubpaths ( string $path, ContainerBuilder $container ) : array Finds existing bundle subpaths.
getConnectionOptions ( $connection )
getDbalConnections ( array $config, ContainerBuilder $container ) Gets the configured DBAL connections.
getEntityManagerCacheDefinition ( array $entityManager, array $cacheDriver, ContainerBuilder $container ) : Definition Gets an entity manager cache driver definition for metadata, query and result caches.
getEntityManagerCacheDefinition ( array $entityManager, string $cacheDriver, ContainerBuilder $container ) : Definition Gets an entity manager cache driver definition for metadata, query and result caches.
getMappingObjectDefaultName ( )
getMappingResourceConfigDirectory ( )
getMappingResourceExtension ( )
getObjectManagerElementName ( $name )
getOrmEntityManagers ( array $config, ContainerBuilder $container ) Gets the configured entity managers.
loadDbalConnection ( array $connection, ContainerBuilder $container ) Loads a configured DBAL connection.
loadDbalConnection ( string $name, array $connection, ContainerBuilder $container ) Loads a configured DBAL connection.
loadDbalConnections ( array $config, ContainerBuilder $container ) Loads the configured DBAL connections.
loadDbalDefaults ( array $config, ContainerBuilder $container ) Loads the DBAL configuration defaults.
loadOrmCacheDrivers ( array $entityManager, ContainerBuilder $container ) Loads a configured entity managers cache drivers.
loadOrmDefaults ( array $config, ContainerBuilder $container ) Loads the ORM default configuration.
loadOrmEntityManager ( array $entityManager, ContainerBuilder $container ) Loads a configured ORM entity manager.
loadOrmEntityManagerBundlesMappingInformation ( array $entityManager, Definition $ormConfigDef, ContainerBuilder $container ) Loads an ORM entity managers bundle mapping information.
loadOrmEntityManagerCacheDriver ( array $entityManager, ContainerBuilder $container, string $cacheName ) Loads a configured entity managers metadata, query or result cache driver.
loadOrmEntityManagerMappingInformation ( array $entityManager, Definition $ormConfigDef, ContainerBuilder $container ) Loads an ORM entity managers bundle mapping information.
loadOrmEntityManagerMetadataCacheDriver ( array $entityManager, ContainerBuilder $container ) Loads a configured entity managers metadata cache driver.
loadOrmEntityManagerQueryCacheDriver ( array $entityManager, ContainerBuilder $container ) Loads a configured entity managers query cache driver.
loadOrmEntityManagerResultCacheDriver ( array $entityManager, ContainerBuilder $container ) Loads a configured entity managers result cache driver.
loadOrmEntityManagers ( array $config, ContainerBuilder $container ) Loads the configured ORM entity managers.

Method Details

createOrmProxyDirectory() protected method

Create the Doctrine ORM Entity proxy directory
protected createOrmProxyDirectory ( $tmpDir )

dbalLoad() public method

Usage example:
public dbalLoad ( array $config, ContainerBuilder $container )
$config array An array of configuration settings
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

detectMetadataDriver() protected static method

Detects what metadata driver to use for the supplied directory.
protected static detectMetadataDriver ( string $dir, ContainerBuilder $container ) : string | null
$dir string A directory path
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder configuration
return string | null A metadata driver short name, if one can be detected

findBundleSubpaths() protected method

Finds existing bundle subpaths.
protected findBundleSubpaths ( string $path, ContainerBuilder $container ) : array
$path string A subpath to check for
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder configuration
return array An array of absolute directory paths

getAlias() public method

This alias is also the mandatory prefix to use when using YAML.
public getAlias ( ) : string
return string The alias

getConnectionOptions() protected method

protected getConnectionOptions ( $connection )

getDbalConnections() protected method

Gets the configured DBAL connections.
protected getDbalConnections ( array $config, ContainerBuilder $container )
$config array An array of configuration settings
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

getEntityManagerCacheDefinition() protected method

Gets an entity manager cache driver definition for metadata, query and result caches.
protected getEntityManagerCacheDefinition ( array $entityManager, array $cacheDriver, ContainerBuilder $container ) : Definition
$entityManager array The array configuring an entity manager.
$cacheDriver array The cache driver configuration.
$container Symfony\Component\DependencyInjection\ContainerBuilder
return Symfony\Component\DependencyInjection\Definition $cacheDef

getEntityManagerCacheDefinition() protected method

Gets an entity manager cache driver definition for metadata, query and result caches.
protected getEntityManagerCacheDefinition ( array $entityManager, string $cacheDriver, ContainerBuilder $container ) : Definition
$entityManager array
$cacheDriver string
$container Symfony\Component\DependencyInjection\ContainerBuilder
return Symfony\Component\DependencyInjection\Definition $cacheDef

getMappingObjectDefaultName() protected method

getMappingResourceConfigDirectory() protected method

getMappingResourceExtension() protected method

getNamespace() public method

Returns the namespace to be used for this extension (XML namespace).
public getNamespace ( ) : string
return string The XML namespace

getObjectManagerElementName() protected method

protected getObjectManagerElementName ( $name )

getOrmEntityManagers() protected method

Gets the configured entity managers.
protected getOrmEntityManagers ( array $config, ContainerBuilder $container )
$config array An array of configuration settings
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

getXsdValidationBasePath() public method

Returns the base path for the XSD files.
public getXsdValidationBasePath ( ) : string
return string The XSD base path

load() public method

public load ( array $configs, ContainerBuilder $container )
$configs array
$container Symfony\Component\DependencyInjection\ContainerBuilder

loadDbalConnection() protected method

Loads a configured DBAL connection.
protected loadDbalConnection ( array $connection, ContainerBuilder $container )
$connection array A dbal connection configuration.
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

loadDbalConnection() protected method

Loads a configured DBAL connection.
protected loadDbalConnection ( string $name, array $connection, ContainerBuilder $container )
$name string The name of the connection
$connection array A dbal connection configuration.
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

loadDbalConnections() protected method

Loads the configured DBAL connections.
protected loadDbalConnections ( array $config, ContainerBuilder $container )
$config array An array of configuration settings
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

loadDbalDefaults() protected method

Loads the DBAL configuration defaults.
protected loadDbalDefaults ( array $config, ContainerBuilder $container )
$config array An array of configuration settings
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

loadOrmCacheDrivers() protected method

Loads a configured entity managers cache drivers.
protected loadOrmCacheDrivers ( array $entityManager, ContainerBuilder $container )
$entityManager array A configured ORM entity manager.
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

loadOrmDefaults() protected method

Loads the ORM default configuration.
protected loadOrmDefaults ( array $config, ContainerBuilder $container )
$config array An array of configuration settings
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

loadOrmEntityManager() protected method

Loads a configured ORM entity manager.
protected loadOrmEntityManager ( array $entityManager, ContainerBuilder $container )
$entityManager array A configured ORM entity manager.
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

loadOrmEntityManagerBundlesMappingInformation() protected method

Loads an ORM entity managers bundle mapping information.
protected loadOrmEntityManagerBundlesMappingInformation ( array $entityManager, Definition $ormConfigDef, ContainerBuilder $container )
$entityManager array A configured ORM entity manager.
$ormConfigDef Symfony\Component\DependencyInjection\Definition
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

loadOrmEntityManagerCacheDriver() protected method

Loads a configured entity managers metadata, query or result cache driver.
protected loadOrmEntityManagerCacheDriver ( array $entityManager, ContainerBuilder $container, string $cacheName )
$entityManager array A configured ORM entity manager.
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance
$cacheName string

loadOrmEntityManagerMappingInformation() protected method

There are two distinct configuration possibilities for mapping information: 1. Specify a bundle and optionally details where the entity and mapping information reside. 2. Specify an arbitrary mapping location.
protected loadOrmEntityManagerMappingInformation ( array $entityManager, Definition $ormConfigDef, ContainerBuilder $container )
$entityManager array A configured ORM entity manager.
$ormConfigDef Symfony\Component\DependencyInjection\Definition
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

loadOrmEntityManagerMetadataCacheDriver() protected method

Loads a configured entity managers metadata cache driver.
protected loadOrmEntityManagerMetadataCacheDriver ( array $entityManager, ContainerBuilder $container )
$entityManager array A configured ORM entity manager.
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

loadOrmEntityManagerQueryCacheDriver() protected method

Loads a configured entity managers query cache driver.
protected loadOrmEntityManagerQueryCacheDriver ( array $entityManager, ContainerBuilder $container )
$entityManager array A configured ORM entity manager.
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

loadOrmEntityManagerResultCacheDriver() protected method

Loads a configured entity managers result cache driver.
protected loadOrmEntityManagerResultCacheDriver ( array $entityManager, ContainerBuilder $container )
$entityManager array A configured ORM entity manager.
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

loadOrmEntityManagers() protected method

Loads the configured ORM entity managers.
protected loadOrmEntityManagers ( array $config, ContainerBuilder $container )
$config array An array of configuration settings
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance

ormLoad() public method

Usage example:
public ormLoad ( array $config, ContainerBuilder $container )
$config array An array of configuration settings
$container Symfony\Component\DependencyInjection\ContainerBuilder A ContainerBuilder instance