PHP Class Bisna\Doctrine\Container

Author: Guilherme Blanco ([email protected])
Show file Open project: guilhermeblanco/zendframework1-doctrine2

Public Properties

Property Type Description
$defaultCacheInstance Default Cache Instance name.
$defaultConnection Default DBAL Connection name.
$defaultDocumentManager Default ODM DocumentManager name.
$defaultEntityManager Default ORM EntityManager name.

Public Methods

Method Description
__construct ( array $config = [] ) Constructor.
getCacheInstance ( string $cacheName = null ) : Doctrine\Common\Cache\Cache Retrieve Cache Instance based on its name. If no argument is provided, it will attempt to get the default Instance.
getCacheInstanceNames ( ) : array Retrieves a list of names for all cache instances configured
getConnection ( string $connName = null ) : Doctrine\DBAL\Connection Retrieve DBAL Connection based on its name. If no argument is provided, it will attempt to get the default Connection.
getConnectionNames ( ) : array Retrieves a list of names for all Connections configured and/or loaded
getDocumentManager ( string $dmName = null ) : DocumentManager Retrieve ODM DocumentManager based on its name. If no argument provided, it will attempt to get the default DocumentManager.
getEntityManager ( string $emName = null ) : EntityManager Retrieve ORM EntityManager based on its name. If no argument provided, it will attempt to get the default EntityManager.
getEntityManagerNames ( ) : array Retrieves a list of names for all Entity Managers configured and/or loaded

Private Methods

Method Description
prepareCacheInstanceConfiguration ( array $config = [] ) : array Prepare Cache Instances configurations.
prepareDBALConfiguration ( array $config = [] ) : array Prepare DBAL Connections configurations.
prepareODMConfiguration ( array $config = [] ) : array Prepare ODM EntityManagers configurations.
prepareORMConfiguration ( array $config = [] ) : array Prepare ORM EntityManagers configurations.
registerClassLoaders ( array $config = [] ) Register Doctrine Class Loaders
startAnnotationRegistry ( array $config ) Initialize ORM Metadata Annotation Registry driver
startCacheInstance ( array $config = [] ) : Doctrine\Common\Cache\Cache Initialize Cache Instance.
startDBALConfiguration ( array $config = [] ) : Doctrine\DBAL\Configuration Initialize the DBAL Configuration.
startDBALConnection ( array $config = [] ) : Doctrine\DBAL\Connection Initialize the DBAL Connection.
startDBALEventManager ( array $config = [] ) : Doctrine\Common\EventManager Initialize the EventManager.
startODMConfiguration ( array $config = [] ) : Configuration Initialize ODM Configuration.
startODMDocumentManager ( array $config = [] ) : DocumentManager Initialize the ODM Document Manager
startODMMetadata ( array $config = [] ) : Doctrine\ODM\MongoDB\Mapping\Driver\DriverChain Initialize ODM Metadata drivers.
startORMConfiguration ( array $config = [] ) : Doctrine\ORM\Configuration Initialize ORM Configuration.
startORMEntityManager ( array $config = [] ) : EntityManager Initialize ORM EntityManager.
startORMMetadata ( array $config = [] ) : Doctrine\ORM\Mapping\Driver\DriverChain Initialize ORM Metadata drivers.

Method Details

__construct() public method

Constructor.
public __construct ( array $config = [] )
$config array Doctrine Container configuration

getCacheInstance() public method

If Cache Instance name could not be found, NameNotFoundException is thrown.
public getCacheInstance ( string $cacheName = null ) : Doctrine\Common\Cache\Cache
$cacheName string Optional Cache Instance name
return Doctrine\Common\Cache\Cache Cache Instance

getCacheInstanceNames() public method

Retrieves a list of names for all cache instances configured
public getCacheInstanceNames ( ) : array
return array

getConnection() public method

If DBAL Connection name could not be found, NameNotFoundException is thrown.
public getConnection ( string $connName = null ) : Doctrine\DBAL\Connection
$connName string Optional DBAL Connection name
return Doctrine\DBAL\Connection DBAL Connection

getConnectionNames() public method

Retrieves a list of names for all Connections configured and/or loaded
public getConnectionNames ( ) : array
return array

getDocumentManager() public method

If ODM DocumentManager name could not be found, NameNotFoundException is thrown.
public getDocumentManager ( string $dmName = null ) : DocumentManager
$dmName string Optional ODM DocumentManager name
return Doctrine\ODM\MongoDB\DocumentManager

getEntityManager() public method

If ORM EntityManager name could not be found, NameNotFoundException is thrown.
public getEntityManager ( string $emName = null ) : EntityManager
$emName string Optional ORM EntityManager name
return Doctrine\ORM\EntityManager ORM EntityManager

getEntityManagerNames() public method

Retrieves a list of names for all Entity Managers configured and/or loaded
public getEntityManagerNames ( ) : array
return array

Property Details

$defaultCacheInstance public property

Default Cache Instance name.
public $defaultCacheInstance

$defaultConnection public property

Default DBAL Connection name.
public $defaultConnection

$defaultDocumentManager public property

Default ODM DocumentManager name.
public $defaultDocumentManager

$defaultEntityManager public property

Default ORM EntityManager name.
public $defaultEntityManager