Documentation

PoolingShardConnection extends Connection
in package

Sharding implementation that pools many different connections internally and serves data from the currently active connection.

The internals of this class are:

  • All sharding clients are specified and given a shard-id during configuration.
  • By default, the global shard is selected. If no global shard is configured an exception is thrown on access.
  • Selecting a shard by distribution value delegates the mapping "distributionValue" => "client" to the ShardChooser interface.
  • An exception is thrown if trying to switch shards during an open transaction.

Instantiation through the DriverManager looks like:

Tags
example

$conn = DriverManager::getConnection(array( 'wrapperClass' => 'Doctrine\DBAL\Sharding\PoolingShardConnection', 'driver' => 'pdo_mysql', 'global' => array('user' => '', 'password' => '', 'host' => '', 'dbname' => ''), 'shards' => array( array('id' => 1, 'user' => 'slave1', 'password', 'host' => '', 'dbname' => ''), array('id' => 2, 'user' => 'slave2', 'password', 'host' => '', 'dbname' => ''), ), 'shardChoser' => 'Doctrine\DBAL\Sharding\ShardChoser\MultiTenantShardChoser', )); $shardManager = $conn->getShardManager(); $shardManager->selectGlobal(); $shardManager->selectShard($value);

author

Benjamin Eberlei kontakt@beberlei.de

Table of Contents

ARRAY_PARAM_OFFSET  = 100
Offset by which PARAM_* constants are detected as arrays of the param type.
PARAM_INT_ARRAY  = 101
Represents an array of ints to be expanded by Doctrine SQL parsing.
PARAM_STR_ARRAY  = 102
Represents an array of strings to be expanded by Doctrine SQL parsing.
TRANSACTION_READ_COMMITTED  = 2
Constant for transaction isolation level READ COMMITTED.
TRANSACTION_READ_UNCOMMITTED  = 1
Constant for transaction isolation level READ UNCOMMITTED.
TRANSACTION_REPEATABLE_READ  = 3
Constant for transaction isolation level REPEATABLE READ.
TRANSACTION_SERIALIZABLE  = 4
Constant for transaction isolation level SERIALIZABLE.
$_config  : Configuration
$_conn  : Connection
The wrapped driver connection.
$_driver  : Driver
The used DBAL driver.
$_eventManager  : EventManager
$_expr  : ExpressionBuilder
$_schemaManager  : AbstractSchemaManager
The schema manager.
$defaultFetchMode  : int
$_isConnected  : bool
Whether or not a connection has been established.
$_isRollbackOnly  : bool
Flag that indicates whether the current transaction is marked for rollback only.
$_nestTransactionsWithSavepoints  : bool
If nested transactions should use savepoints.
$_params  : array<string|int, mixed>
The parameters used during creation of the Connection instance.
$_transactionIsolationLevel  : int
The currently active transaction isolation level.
$_transactionNestingLevel  : int
The transaction nesting level.
$activeConnections  : array<string|int, mixed>
$activeShardId  : int
$autoCommit  : bool
The current auto-commit mode of this connection.
$connections  : array<string|int, mixed>
$platform  : AbstractPlatform
The DatabasePlatform object that provides information about the database platform used by the connection.
__construct()  : mixed
Initializes a new instance of the Connection class.
beginTransaction()  : void
Starts a transaction by suspending auto-commit mode.
close()  : void
Closes the connection.
commit()  : void
Commits the current transaction.
connect()  : bool
Connects to a given shard.
convertToDatabaseValue()  : mixed
Converts a given value to its database representation according to the conversion rules of a specific DBAL mapping type.
convertToPHPValue()  : mixed
Converts a given value to its PHP representation according to the conversion rules of a specific DBAL mapping type.
createQueryBuilder()  : QueryBuilder
Creates a new instance of a SQL query builder.
createSavepoint()  : void
Creates a new savepoint.
delete()  : int
Executes an SQL DELETE statement on a table.
errorCode()  : int
Fetches the SQLSTATE associated with the last database operation.
errorInfo()  : array<string|int, mixed>
Fetches extended error information associated with the last database operation.
exec()  : int
Executes an SQL statement and return the number of affected rows.
executeCacheQuery()  : ResultStatement
Executes a caching query.
executeQuery()  : Statement
Executes an, optionally parametrized, SQL query.
executeUpdate()  : int
Executes an SQL INSERT/UPDATE/DELETE query with the given parameters and returns the number of affected rows.
fetchAll()  : array<string|int, mixed>
Prepares and executes an SQL query and returns the result as an associative array.
fetchArray()  : array<string|int, mixed>
Prepares and executes an SQL query and returns the first row of the result as a numerically indexed array.
fetchAssoc()  : array<string|int, mixed>
Prepares and executes an SQL query and returns the first row of the result as an associative array.
fetchColumn()  : mixed
Prepares and executes an SQL query and returns the value of a single column of the first row of the result.
getActiveShardId()  : int
Get active shard id.
getConfiguration()  : Configuration
Gets the Configuration used by the Connection.
getDatabase()  : string
Gets the name of the database this Connection is connected to.
getDatabasePlatform()  : AbstractPlatform
Gets the DatabasePlatform for the connection.
getDriver()  : Driver
Gets the DBAL driver instance.
getEventManager()  : EventManager
Gets the EventManager used by the Connection.
getExpressionBuilder()  : ExpressionBuilder
Gets the ExpressionBuilder for the connection.
getHost()  : string|null
Gets the hostname of the currently connected database.
getNestTransactionsWithSavepoints()  : bool
Gets if nested transactions should use savepoints.
getParams()  : array<string|int, mixed>
Gets the parameters used during instantiation.
getPassword()  : string|null
Gets the password used by this connection.
getPort()  : mixed
Gets the port of the currently connected database.
getSchemaManager()  : AbstractSchemaManager
Gets the SchemaManager that can be used to inspect or change the database schema through the connection.
getTransactionIsolation()  : int
Gets the currently active transaction isolation level.
getTransactionNestingLevel()  : int
Returns the current transaction nesting level.
getUsername()  : string|null
Gets the username used by this connection.
getWrappedConnection()  : Connection
Gets the wrapped driver connection.
insert()  : int
Inserts a table row with specified data.
isAutoCommit()  : bool
Returns the current auto-commit mode for this connection.
isConnected()  : bool
Whether an actual connection to the database is established.
isRollbackOnly()  : bool
Checks whether the current transaction is marked for rollback only.
isTransactionActive()  : bool
Checks whether a transaction is currently active.
lastInsertId()  : string
Returns the ID of the last inserted row, or the last value from a sequence object, depending on the underlying driver.
ping()  : bool
Ping the server
prepare()  : Statement
Prepares an SQL statement.
project()  : array<string|int, mixed>
Executes an, optionally parametrized, SQL query and returns the result, applying a given projection/transformation function on each row of the result.
query()  : Statement
Executes an SQL statement, returning a result set as a Statement object.
quote()  : string
Quotes a given input parameter.
quoteIdentifier()  : string
Quotes a string so it can be safely used as a table or column name, even if it is a reserved name.
releaseSavepoint()  : void
Releases the given savepoint.
rollBack()  : bool
Cancels any database changes done during the current transaction.
rollbackSavepoint()  : void
Rolls back to the given savepoint.
setAutoCommit()  : mixed
Sets auto-commit mode for this connection.
setFetchMode()  : void
Sets the fetch mode.
setNestTransactionsWithSavepoints()  : void
Sets if nested transactions should use savepoints.
setRollbackOnly()  : void
Marks the current transaction so that the only possible outcome for the transaction to be rolled back.
setTransactionIsolation()  : int
Sets the transaction isolation level.
transactional()  : void
Executes a function in a transaction.
update()  : int
Executes an SQL UPDATE statement on a table.
_getNestedTransactionSavePointName()  : mixed
Returns the savepoint name to use for nested transactions are false if they are not supported "savepointFormat" parameter is not set
connectTo()  : Connection
Connects to a specific connection.
commitAll()  : mixed
Commits all current nesting transactions.
detectDatabasePlatform()  : mixed
Detects and sets the database platform.
extractTypeValues()  : array<string|int, mixed>
Extract ordered type list from an ordered column list and type map.
getBindingInfo()  : array<string|int, mixed>
Gets the binding type of a given type. The given type can be a PDO or DBAL mapping type.
getDatabasePlatformVersion()  : string|null
Returns the version of the related platform if applicable.

Constants

ARRAY_PARAM_OFFSET

Offset by which PARAM_* constants are detected as arrays of the param type.

public int ARRAY_PARAM_OFFSET = 100

PARAM_INT_ARRAY

Represents an array of ints to be expanded by Doctrine SQL parsing.

public int PARAM_INT_ARRAY = 101

PARAM_STR_ARRAY

Represents an array of strings to be expanded by Doctrine SQL parsing.

public int PARAM_STR_ARRAY = 102

TRANSACTION_READ_COMMITTED

Constant for transaction isolation level READ COMMITTED.

public mixed TRANSACTION_READ_COMMITTED = 2

TRANSACTION_READ_UNCOMMITTED

Constant for transaction isolation level READ UNCOMMITTED.

public mixed TRANSACTION_READ_UNCOMMITTED = 1

TRANSACTION_REPEATABLE_READ

Constant for transaction isolation level REPEATABLE READ.

public mixed TRANSACTION_REPEATABLE_READ = 3

TRANSACTION_SERIALIZABLE

Constant for transaction isolation level SERIALIZABLE.

public mixed TRANSACTION_SERIALIZABLE = 4

Properties

$defaultFetchMode

protected int $defaultFetchMode = PDO::FETCH_ASSOC

$_isConnected

Whether or not a connection has been established.

private bool $_isConnected = false

$_isRollbackOnly

Flag that indicates whether the current transaction is marked for rollback only.

private bool $_isRollbackOnly = false

$_nestTransactionsWithSavepoints

If nested transactions should use savepoints.

private bool $_nestTransactionsWithSavepoints = false

$_params

The parameters used during creation of the Connection instance.

private array<string|int, mixed> $_params = array()

$_transactionIsolationLevel

The currently active transaction isolation level.

private int $_transactionIsolationLevel

$_transactionNestingLevel

The transaction nesting level.

private int $_transactionNestingLevel = 0

$autoCommit

The current auto-commit mode of this connection.

private bool $autoCommit = true

$platform

The DatabasePlatform object that provides information about the database platform used by the connection.

private AbstractPlatform $platform

Methods

__construct()

Initializes a new instance of the Connection class.

public __construct(array<string|int, mixed> $params, Driver $driver[, Configuration $config = null ][, EventManager $eventManager = null ]) : mixed
Parameters
$params : array<string|int, mixed>
$driver : Driver
$config : Configuration = null
$eventManager : EventManager = null
Tags
throws
InvalidArgumentException
Return values
mixed

beginTransaction()

Starts a transaction by suspending auto-commit mode.

public beginTransaction() : void
Return values
void

commit()

Commits the current transaction.

public commit() : void
Tags
throws
ConnectionException

If the commit failed due to no active transaction or because the transaction was marked for rollback only.

Return values
void

convertToDatabaseValue()

Converts a given value to its database representation according to the conversion rules of a specific DBAL mapping type.

public convertToDatabaseValue(mixed $value, string $type) : mixed
Parameters
$value : mixed

The value to convert.

$type : string

The name of the DBAL mapping type.

Return values
mixed

The converted value.

convertToPHPValue()

Converts a given value to its PHP representation according to the conversion rules of a specific DBAL mapping type.

public convertToPHPValue(mixed $value, string $type) : mixed
Parameters
$value : mixed

The value to convert.

$type : string

The name of the DBAL mapping type.

Return values
mixed

The converted type.

createSavepoint()

Creates a new savepoint.

public createSavepoint(string $savepoint) : void
Parameters
$savepoint : string

The name of the savepoint to create.

Tags
throws
ConnectionException
Return values
void

delete()

Executes an SQL DELETE statement on a table.

public delete(string $tableExpression, array<string|int, mixed> $identifier[, array<string|int, mixed> $types = array() ]) : int

Table expression and columns are not escaped and are not safe for user-input.

Parameters
$tableExpression : string

The expression of the table on which to delete.

$identifier : array<string|int, mixed>

The deletion criteria. An associative array containing column-value pairs.

$types : array<string|int, mixed> = array()

The types of identifiers.

Tags
throws
InvalidArgumentException
Return values
int

The number of affected rows.

errorCode()

Fetches the SQLSTATE associated with the last database operation.

public errorCode() : int
Return values
int

The last error code.

errorInfo()

Fetches extended error information associated with the last database operation.

public errorInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>

The last error information.

exec()

Executes an SQL statement and return the number of affected rows.

public exec(string $statement) : int
Parameters
$statement : string
Tags
throws
DBALException
Return values
int

The number of affected rows.

executeCacheQuery()

Executes a caching query.

public executeCacheQuery(string $query, array<string|int, mixed> $params, array<string|int, mixed> $types, QueryCacheProfile $qcp) : ResultStatement
Parameters
$query : string

The SQL query to execute.

$params : array<string|int, mixed>

The parameters to bind to the query, if any.

$types : array<string|int, mixed>

The types the previous parameters are in.

$qcp : QueryCacheProfile

The query cache profile.

Tags
throws
CacheException
Return values
ResultStatement

executeQuery()

Executes an, optionally parametrized, SQL query.

public executeQuery(string $query[, array<string|int, mixed> $params = array() ][, array<string|int, mixed> $types = array() ][, QueryCacheProfile|null $qcp = null ]) : Statement

If the query is parametrized, a prepared statement is used. If an SQLLogger is configured, the execution is logged.

Parameters
$query : string

The SQL query to execute.

$params : array<string|int, mixed> = array()

The parameters to bind to the query, if any.

$types : array<string|int, mixed> = array()

The types the previous parameters are in.

$qcp : QueryCacheProfile|null = null

The query cache profile, optional.

Tags
throws
DBALException
Return values
Statement

The executed statement.

executeUpdate()

Executes an SQL INSERT/UPDATE/DELETE query with the given parameters and returns the number of affected rows.

public executeUpdate(string $query[, array<string|int, mixed> $params = array() ][, array<string|int, mixed> $types = array() ]) : int

This method supports PDO binding types as well as DBAL mapping types.

Parameters
$query : string

The SQL query.

$params : array<string|int, mixed> = array()

The query parameters.

$types : array<string|int, mixed> = array()

The parameter types.

Tags
throws
DBALException
Return values
int

The number of affected rows.

fetchAll()

Prepares and executes an SQL query and returns the result as an associative array.

public fetchAll(string $sql[, array<string|int, mixed> $params = array() ][, array<string|int, mixed> $types = array() ]) : array<string|int, mixed>
Parameters
$sql : string

The SQL query.

$params : array<string|int, mixed> = array()

The query parameters.

$types : array<string|int, mixed> = array()

The query parameter types.

Return values
array<string|int, mixed>

fetchArray()

Prepares and executes an SQL query and returns the first row of the result as a numerically indexed array.

public fetchArray(string $statement[, array<string|int, mixed> $params = array() ][, array<string|int, mixed> $types = array() ]) : array<string|int, mixed>
Parameters
$statement : string

The SQL query to be executed.

$params : array<string|int, mixed> = array()

The prepared statement params.

$types : array<string|int, mixed> = array()

The query parameter types.

Return values
array<string|int, mixed>

fetchAssoc()

Prepares and executes an SQL query and returns the first row of the result as an associative array.

public fetchAssoc(string $statement[, array<string|int, mixed> $params = array() ][, array<string|int, mixed> $types = array() ]) : array<string|int, mixed>
Parameters
$statement : string

The SQL query.

$params : array<string|int, mixed> = array()

The query parameters.

$types : array<string|int, mixed> = array()

The query parameter types.

Return values
array<string|int, mixed>

fetchColumn()

Prepares and executes an SQL query and returns the value of a single column of the first row of the result.

public fetchColumn(string $statement[, array<string|int, mixed> $params = array() ], int $column[, array<string|int, mixed> $types = array() ]) : mixed
Parameters
$statement : string

The SQL query to be executed.

$params : array<string|int, mixed> = array()

The prepared statement params.

$column : int

The 0-indexed column number to retrieve.

$types : array<string|int, mixed> = array()

The query parameter types.

Return values
mixed

getConfiguration()

Gets the Configuration used by the Connection.

public getConfiguration() : Configuration
Return values
Configuration

getDatabase()

Gets the name of the database this Connection is connected to.

public getDatabase() : string
Return values
string

getHost()

Gets the hostname of the currently connected database.

public getHost() : string|null
Return values
string|null

getNestTransactionsWithSavepoints()

Gets if nested transactions should use savepoints.

public getNestTransactionsWithSavepoints() : bool
Return values
bool

getParams()

Gets the parameters used during instantiation.

public getParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPassword()

Gets the password used by this connection.

public getPassword() : string|null
Return values
string|null

getPort()

Gets the port of the currently connected database.

public getPort() : mixed
Return values
mixed

getTransactionIsolation()

Gets the currently active transaction isolation level.

public getTransactionIsolation() : int
Return values
int

The current transaction isolation level.

getTransactionNestingLevel()

Returns the current transaction nesting level.

public getTransactionNestingLevel() : int
Return values
int

The nesting level. A value of 0 means there's no active transaction.

getUsername()

Gets the username used by this connection.

public getUsername() : string|null
Return values
string|null

insert()

Inserts a table row with specified data.

public insert(string $tableExpression, array<string|int, mixed> $data[, array<string|int, mixed> $types = array() ]) : int

Table expression and columns are not escaped and are not safe for user-input.

Parameters
$tableExpression : string

The expression of the table to insert data into, quoted or unquoted.

$data : array<string|int, mixed>

An associative array containing column-value pairs.

$types : array<string|int, mixed> = array()

Types of the inserted data.

Return values
int

The number of affected rows.

isAutoCommit()

Returns the current auto-commit mode for this connection.

public isAutoCommit() : bool
Tags
see
setAutoCommit
Return values
bool

True if auto-commit mode is currently enabled for this connection, false otherwise.

isConnected()

Whether an actual connection to the database is established.

public isConnected([string|null $shardId = null ]) : bool
Parameters
$shardId : string|null = null
Return values
bool

isRollbackOnly()

Checks whether the current transaction is marked for rollback only.

public isRollbackOnly() : bool
Tags
throws
ConnectionException

If no transaction is active.

Return values
bool

isTransactionActive()

Checks whether a transaction is currently active.

public isTransactionActive() : bool
Return values
bool

TRUE if a transaction is currently active, FALSE otherwise.

lastInsertId()

Returns the ID of the last inserted row, or the last value from a sequence object, depending on the underlying driver.

public lastInsertId([string|null $seqName = null ]) : string

Note: This method may not return a meaningful or consistent result across different drivers, because the underlying database may not even support the notion of AUTO_INCREMENT/IDENTITY columns or sequences.

Parameters
$seqName : string|null = null

Name of the sequence object from which the ID should be returned.

Return values
string

A string representation of the last inserted ID.

ping()

Ping the server

public ping() : bool

When the server is not available the method returns FALSE. It is responsibility of the developer to handle this case and abort the request or reconnect manually:

Tags
example

if ($conn->ping() === false) { $conn->close(); $conn->connect(); }

It is undefined if the underlying driver attempts to reconnect or disconnect when the connection is not available anymore as long it returns TRUE when a reconnect succeeded and FALSE when the connection was dropped.

Return values
bool

prepare()

Prepares an SQL statement.

public prepare(string $statement) : Statement
Parameters
$statement : string

The SQL statement to prepare.

Tags
throws
DBALException
Return values
Statement

The prepared statement.

project()

Executes an, optionally parametrized, SQL query and returns the result, applying a given projection/transformation function on each row of the result.

public project(string $query, array<string|int, mixed> $params, Closure $function) : array<string|int, mixed>
Parameters
$query : string

The SQL query to execute.

$params : array<string|int, mixed>

The parameters, if any.

$function : Closure

The transformation function that is applied on each row. The function receives a single parameter, an array, that represents a row of the result set.

Return values
array<string|int, mixed>

The projected result of the query.

quote()

Quotes a given input parameter.

public quote(mixed $input[, string|null $type = null ]) : string
Parameters
$input : mixed

The parameter to be quoted.

$type : string|null = null

The type of the parameter.

Return values
string

The quoted parameter.

quoteIdentifier()

Quotes a string so it can be safely used as a table or column name, even if it is a reserved name.

public quoteIdentifier(string $str) : string

Delimiting style depends on the underlying database platform that is being used.

NOTE: Just because you CAN use quoted identifiers does not mean you SHOULD use them. In general, they end up causing way more problems than they solve.

Parameters
$str : string

The name to be quoted.

Return values
string

The quoted name.

releaseSavepoint()

Releases the given savepoint.

public releaseSavepoint(string $savepoint) : void
Parameters
$savepoint : string

The name of the savepoint to release.

Tags
throws
ConnectionException
Return values
void

rollBack()

Cancels any database changes done during the current transaction.

public rollBack() : bool

This method can be listened with onPreTransactionRollback and onTransactionRollback eventlistener methods.

Tags
throws
ConnectionException

If the rollback operation failed.

Return values
bool

TRUE on success or FALSE on failure.

rollbackSavepoint()

Rolls back to the given savepoint.

public rollbackSavepoint(string $savepoint) : void
Parameters
$savepoint : string

The name of the savepoint to rollback to.

Tags
throws
ConnectionException
Return values
void

setAutoCommit()

Sets auto-commit mode for this connection.

public setAutoCommit(bool $autoCommit) : mixed

If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback. By default, new connections are in auto-commit mode.

NOTE: If this method is called during a transaction and the auto-commit mode is changed, the transaction is committed. If this method is called and the auto-commit mode is not changed, the call is a no-op.

Parameters
$autoCommit : bool

True to enable auto-commit mode; false to disable it.

Tags
see
isAutoCommit
Return values
mixed

setFetchMode()

Sets the fetch mode.

public setFetchMode(int $fetchMode) : void
Parameters
$fetchMode : int
Return values
void

setNestTransactionsWithSavepoints()

Sets if nested transactions should use savepoints.

public setNestTransactionsWithSavepoints(bool $nestTransactionsWithSavepoints) : void
Parameters
$nestTransactionsWithSavepoints : bool
Tags
throws
ConnectionException
Return values
void

setRollbackOnly()

Marks the current transaction so that the only possible outcome for the transaction to be rolled back.

public setRollbackOnly() : void
Tags
throws
ConnectionException

If no transaction is active.

Return values
void

setTransactionIsolation()

Sets the transaction isolation level.

public setTransactionIsolation(int $level) : int
Parameters
$level : int

The level to set.

Return values
int

transactional()

Executes a function in a transaction.

public transactional(Closure $func) : void

The function gets passed this Connection instance as an (optional) parameter.

If an exception occurs during execution of the function or transaction commit, the transaction is rolled back and the exception re-thrown.

Parameters
$func : Closure

The function to execute transactionally.

Tags
throws
Exception
Return values
void

update()

Executes an SQL UPDATE statement on a table.

public update(string $tableExpression, array<string|int, mixed> $data, array<string|int, mixed> $identifier[, array<string|int, mixed> $types = array() ]) : int

Table expression and columns are not escaped and are not safe for user-input.

Parameters
$tableExpression : string

The expression of the table to update quoted or unquoted.

$data : array<string|int, mixed>

An associative array containing column-value pairs.

$identifier : array<string|int, mixed>

The update criteria. An associative array containing column-value pairs.

$types : array<string|int, mixed> = array()

Types of the merged $data and $identifier arrays in that order.

Return values
int

The number of affected rows.

_getNestedTransactionSavePointName()

Returns the savepoint name to use for nested transactions are false if they are not supported "savepointFormat" parameter is not set

protected _getNestedTransactionSavePointName() : mixed
Return values
mixed

A string with the savepoint name or false.

commitAll()

Commits all current nesting transactions.

private commitAll() : mixed
Return values
mixed

detectDatabasePlatform()

Detects and sets the database platform.

private detectDatabasePlatform() : mixed

Evaluates custom platform class and version in order to set the correct platform.

Tags
throws
DBALException

if an invalid platform was specified for this connection.

Return values
mixed

extractTypeValues()

Extract ordered type list from an ordered column list and type map.

private extractTypeValues(array<string|int, mixed> $columnList, array<string|int, mixed> $types) : array<string|int, mixed>
Parameters
$columnList : array<string|int, mixed>
$types : array<string|int, mixed>
Return values
array<string|int, mixed>

getBindingInfo()

Gets the binding type of a given type. The given type can be a PDO or DBAL mapping type.

private getBindingInfo(mixed $value, mixed $type) : array<string|int, mixed>
Parameters
$value : mixed

The value to bind.

$type : mixed

The type to bind (PDO or DBAL).

Return values
array<string|int, mixed>

[0] => the (escaped) value, [1] => the binding type.

getDatabasePlatformVersion()

Returns the version of the related platform if applicable.

private getDatabasePlatformVersion() : string|null

Returns null if either the driver is not capable to create version specific platform instances, no explicit server version was specified or the underlying driver connection cannot determine the platform version without having to query it (performance reasons).

Return values
string|null

Search results