PHP Класс Blast\Orm\ConnectionManager

Наследование: implements Blast\Orm\ConnectionManagerInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$connections Doctrine\DBAL\Connection[]
$defaultConnection Doctrine\DBAL\Connection
$previousConnections Doctrine\DBAL\Connection[]

Открытые методы

Метод Описание
__destruct ( ) Close all connections on
add ( array | Doctrine\DBAL\Connection | string $connection, string $name = self::DEFAULT_CONNECTION ) Add a new connection to internal cache. Create connection with Blast\Orm\ConnectionManager::create
all ( ) : Doctrine\DBAL\Connection[] | Connection[] Get all connections
closeAll ( ) Disconnect all connections and remove all connections. Collect garbage at least.
create ( $definition ) : Doctrine\DBAL\Connection | Connection Create a new connection from definition.
get ( $name = null ) : Doctrine\DBAL\Connection | Connection Get connection by name.
getInstance ( ) : ConnectionManager Get connection manager instance to share connections between different instances.
getPrevious ( ) : array
has ( $name ) : boolean Check if connections exists
swapActiveConnection ( string $name ) Swap current connection with another connection by name and add previous connection to previous connection stack.

Описание методов

__destruct() публичный Метод

Close all connections on
public __destruct ( )

add() публичный Метод

Add a new connection to internal cache. Create connection with Blast\Orm\ConnectionManager::create
См. также: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#getting-a-connection
public add ( array | Doctrine\DBAL\Connection | string $connection, string $name = self::DEFAULT_CONNECTION )
$connection array | Doctrine\DBAL\Connection | string
$name string

all() публичный Метод

Get all connections
public all ( ) : Doctrine\DBAL\Connection[] | Connection[]
Результат Doctrine\DBAL\Connection[] | Connection[]

closeAll() публичный Метод

Disconnect all connections and remove all connections. Collect garbage at least.
public closeAll ( )

create() публичный статический Метод

If definition is a string, the manager tries to get definition from ioc container, otherwise the manager assumes a valid dsn string and converts definition to an array. If definition is a string manager is determining wrapper class and tries to get wrapper class from container.
public static create ( $definition ) : Doctrine\DBAL\Connection | Connection
$definition
Результат Doctrine\DBAL\Connection | Connection

get() публичный Метод

Get connection by name.
public get ( $name = null ) : Doctrine\DBAL\Connection | Connection
$name
Результат Doctrine\DBAL\Connection | Connection

getInstance() публичный статический Метод

Get connection manager instance to share connections between different instances.
public static getInstance ( ) : ConnectionManager
Результат ConnectionManager

getPrevious() публичный Метод

public getPrevious ( ) : array
Результат array

has() публичный Метод

Check if connections exists
public has ( $name ) : boolean
$name
Результат boolean

swapActiveConnection() публичный Метод

Swap current connection with another connection by name and add previous connection to previous connection stack.
public swapActiveConnection ( string $name )
$name string

Описание свойств

$connections защищенное свойство

protected Connection[],Doctrine\DBAL $connections
Результат Doctrine\DBAL\Connection[]

$defaultConnection защищенное свойство

protected Connection,Doctrine\DBAL $defaultConnection
Результат Doctrine\DBAL\Connection

$previousConnections защищенное свойство

protected Connection[],Doctrine\DBAL $previousConnections
Результат Doctrine\DBAL\Connection[]