1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Класс ConnectionPool

Открытые члены

 __construct ()
 getConnection ($name="")
 setConnectionParameters ($name, $parameters)
 getSlaveConnection ($sql)
 useMasterOnly ($mode)
 ignoreDml ($mode)
 cloneConnection ($name, $newName, array $parameters=[])
 isSlavePossible ()
 isMasterOnly ()
 disconnect ()

Поля данных

const DEFAULT_CONNECTION_NAME = "default"

Защищенные члены

 createConnection ($name, $parameters)
 getConnectionParameters (string $name)
 createSlaveConnection ()

Защищенные данные

 $connections = []
 $connectionParameters = []
 $slavePossible = true
 $ignoreDml = 0
 $masterOnly = 0
 $slaveConnection = null
array $modifiedTables = []

Подробное описание

Connection pool is a connections holder

См. определение в файле connectionpool.php строка 19

Конструктор(ы)

◆ __construct()

__construct ( )

Creates connection pool object

См. определение в файле connectionpool.php строка 37

Методы

◆ cloneConnection()

cloneConnection ( $name,
$newName,
array $parameters = [] )

Creates a new connection based on the supplied one.

Аргументы
string$nameCopy source.
string$newNameCopy target.
array$parametersParameters to be passed to createConnection method.
Возвращает
Connection
Исключения
Config

ConfigurationException

См. определение в файле connectionpool.php строка 303

◆ createConnection()

createConnection ( $name,
$parameters )
protected
Аргументы
string$name
array$parameters
Возвращает
Connection
Исключения
Config

ConfigurationException

См. определение в файле connectionpool.php строка 47

◆ createSlaveConnection()

createSlaveConnection ( )
protected

Creates a new slave connection.

Возвращает
bool | DB\Connection

См. определение в файле connectionpool.php строка 259

◆ disconnect()

disconnect ( )

Disconnects all database connections.

См. определение в файле connectionpool.php строка 340

◆ getConnection()

getConnection ( $name = "")

Returns database connection by its name. Creates new connection if necessary.

Аргументы
string$nameConnection name.
Возвращает
Connection | DB\Connection|null

См. определение в файле connectionpool.php строка 76

◆ getConnectionParameters()

getConnectionParameters ( string $name)
protected

Searches connection parameters (type, host, db, login and password) by connection name

Аргументы
string$nameConnection name
Возвращает
array|null
Исключения

Bitrix\Main\ArgumentNullException

См. определение в файле connectionpool.php строка 107

◆ getSlaveConnection()

getSlaveConnection ( $sql)

Returns a slave connection or null if the query should go to the master.

Аргументы
string$sqlA SQL string. Only SELECT will go to a slave.
Возвращает
DB\Connection|null

См. определение в файле connectionpool.php строка 159

◆ ignoreDml()

ignoreDml ( $mode)

In the ignore DML mode a data modification command will not stop next queries going to a slave.

Аргументы
bool$modeIgnore subsequent DML or not.
Возвращает
void

См. определение в файле connectionpool.php строка 242

◆ isMasterOnly()

isMasterOnly ( )

Returns the state of queries balancing (is the master only can be used).

Возвращает
bool

См. определение в файле connectionpool.php строка 332

◆ isSlavePossible()

isSlavePossible ( )

Returns the state of queries balancing (is a slave still can be used).

Возвращает
bool

См. определение в файле connectionpool.php строка 322

◆ setConnectionParameters()

setConnectionParameters ( $name,
$parameters )

Sets named connection paramters.

Аргументы
string$nameName of the connection.
array$parametersParameters values.
Возвращает
void

См. определение в файле connectionpool.php строка 143

◆ useMasterOnly()

useMasterOnly ( $mode)

In the master-only mode all queries will go to the master.

Аргументы
bool$modeTrue starts the mode and false ends.
Возвращает
void

См. определение в файле connectionpool.php строка 224

Поля

◆ $connectionParameters

$connectionParameters = []
protected

См. определение в файле connectionpool.php строка 27

◆ $connections

$connections = []
protected

См. определение в файле connectionpool.php строка 26

◆ $ignoreDml

$ignoreDml = 0
protected

См. определение в файле connectionpool.php строка 29

◆ $masterOnly

$masterOnly = 0
protected

См. определение в файле connectionpool.php строка 30

◆ $modifiedTables

array $modifiedTables = []
protected

См. определение в файле connectionpool.php строка 32

◆ $slaveConnection

$slaveConnection = null
protected

См. определение в файле connectionpool.php строка 31

◆ $slavePossible

$slavePossible = true
protected

См. определение в файле connectionpool.php строка 28

◆ DEFAULT_CONNECTION_NAME

const DEFAULT_CONNECTION_NAME = "default"

См. определение в файле connectionpool.php строка 21


Объявления и описания членов класса находятся в файле: