PHP 클래스 Blast\Orm\ConnectionManager

상속: implements Blast\Orm\ConnectionManagerInterface
파일 보기 프로젝트 열기: phpthinktank/blast-orm 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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[]