CodeIgniter v4.5 API

BaseConnection
in package
implements ConnectionInterface

AbstractYes
Tags
template

TConnection

template

TResult

implements

ConnectionInterface<TConnection, TResult>

see
BaseConnectionTest

Table of Contents

Interfaces

ConnectionInterface

Properties

$aliasedTables  : array<string|int, mixed>
$charset  : string
$compress  : bool
$connectDuration  : float
$connectTime  : float
$connID  : false|object|resource
Connection ID
$database  : string
$dataCache  : array<string|int, mixed>
Holds previously looked up data for performance reasons.
$dateFormat  : array<string|int, mixed>
$DBCollat  : string
$DBDebug  : bool
$DBDriver  : string
$DBPrefix  : string
$DSN  : string
$encrypt  : array<string|int, mixed>|bool
$escapeChar  : array<string|int, mixed>|string
Identifier escape character
$failover  : array<string|int, mixed>
$hostname  : string
$lastQuery  : Query
$likeEscapeChar  : string
ESCAPE character
$likeEscapeStr  : string
ESCAPE statement string
$password  : string
$pConnect  : bool
$port  : int|string
$pretend  : bool
$protectIdentifiers  : bool
Protect identifiers flag
$queryClass  : string
$reservedIdentifiers  : array<string|int, mixed>
$resultID  : false|object|resource
Result ID
$strictOn  : bool
$subdriver  : string
$swapPre  : string
$transDepth  : int
$transEnabled  : bool
Transaction enabled flag
$transFailure  : bool
$transStatus  : bool
$transStrict  : bool
Strict transaction mode flag
$username  : string
$aliasedTables  : array<string|int, mixed>
Array of table aliases.
$charset  : string
Character set
$compress  : bool
Compression flag
$connectDuration  : float
How long it took to establish connection.
$connectTime  : float
Microtime when connection was made
$database  : string
Database name
$dateFormat  : array<string, string>
Default Date/Time formats
$DBCollat  : string
Collation
$DBDebug  : bool
Whether to throw Exception or not when an error occurs.
$DBDriver  : string
Database driver
$DBPrefix  : string
Table prefix
$DSN  : string
Data Source Name / Connect string
$encrypt  : array<string|int, mixed>|bool
Encryption flag/data
$failover  : array<string|int, mixed>
Settings for a failover connection.
$hostname  : string
Hostname
$lastQuery  : Query
The last query object that was executed on this connection.
$password  : string
Password
$pConnect  : bool
Persistent connection flag
$port  : int|string
Database port
$pregEscapeChar  : array<string|int, mixed>
RegExp used to escape identifiers
$pretend  : bool
If true, no queries will actually be run against the database.
$queryClass  : string
Query Class
$reservedIdentifiers  : array<string|int, mixed>
List of reserved identifiers
$strictOn  : bool|null
Strict ON flag
$subdriver  : string
Sub-driver
$swapPre  : string
Swap Prefix
$transDepth  : int
Transaction depth level
$transException  : bool
Whether to throw exceptions during transaction
$transFailure  : bool
Transaction failure flag
$transStatus  : bool
Transaction status flag
$username  : string
Username

Methods

__construct()  : mixed
Saves our connection settings.
__get()  : array<string|int, mixed>|bool|float|int|object|resource|string|null
Accessor for properties if they exist.
__isset()  : bool
Checker for properties existence.
addTableAlias()  : $this
Add a table alias to our list.
affectedRows()  : int
Returns the total number of rows affected by this query.
callFunction()  : array<string|int, mixed>|bool|float|int|object|resource|string|null
This function enables you to call PHP database functions that are not natively included in CodeIgniter, in a platform independent manner.
close()  : void
Close the database connection.
disableForeignKeyChecks()  : bool
Disables foreign key checks temporarily.
enableForeignKeyChecks()  : bool
Enables foreign key checks temporarily.
error()  : array<string, int|string|null>
Returns the last error code and message.
escape()  : array<string|int, mixed>|float|int|string
"Smart" Escape String
escapeIdentifier()  : string
Escape the SQL Identifier
escapeIdentifiers()  : array<string|int, mixed>|string
Escape the SQL Identifiers
escapeLikeString()  : array<int, string>|string
Escape LIKE String
escapeString()  : array<int, string>|string
Escape String
fieldExists()  : bool
Determine if a particular field exists
getConnectDuration()  : string
Returns the number of seconds with microseconds that it took to connect to the database.
getConnection()  : false|object|resource
Returns the actual connection object. If both a 'read' and 'write' connection has been specified, you can pass either term in to get that connection. If you pass either alias in and only a single connection is present, it must return the sole connection.
getConnectStart()  : float|null
Returns the time we started to connect to this database in seconds with microseconds.
getDatabase()  : string
Returns the name of the current database being used.
getFieldData()  : array<int, stdClass>
Returns an object with field data
getFieldNames()  : false|array<int, string>
Fetch Field Names
getForeignKeyData()  : array<string, stdClass>
Returns an object with foreign key data
getIndexData()  : array<string, stdClass>
Returns an object with key data
getLastQuery()  : Query
Returns the last query's statement object.
getPlatform()  : string
The name of the platform in use (MySQLi, Postgre, SQLite3, OCI8, etc)
getPrefix()  : string
Returns the database prefix.
initialize()  : void
Initializes the database connection/settings.
insertID()  : int|string
Insert ID
isWriteType()  : bool
Determines if the statement is a write-type query or not.
listTables()  : false|array<int, string>
Returns an array of table names
newQuery()  : BaseBuilder
Returns a new instance of the BaseBuilder class with a cleared FROM clause.
persistentConnect()  : false|object|resource
Create a persistent database connection.
prefixTable()  : string
Prepends a database prefix if one exists in configuration
prepare()  : BasePreparedQuery|null
Creates a prepared statement with the database that can then be used to execute multiple statements against. Within the closure, you would build the query in any normal way, though the Query Builder is the expected manner.
pretend()  : $this
Allows the engine to be set into a mode where queries are not actually executed, but they are still generated, timed, etc.
protectIdentifiers()  : array<string|int, mixed>|string
Protect Identifiers
query()  : BaseResult|bool|Query
Orchestrates a query against the database. Queries must use Database\Statement objects to store the query and build it.
resetDataCache()  : $this
Empties our data cache. Especially helpful during testing.
setAliasedTables()  : $this
Sets the Table Aliases to use. These are typically collected during use of the Builder, and set here so queries are built correctly.
setPrefix()  : string
Set DB Prefix
showLastQuery()  : string
Returns a string representation of the last query's statement object.
simpleQuery()  : false|object|resource
Performs a basic query against the database. No binding or caching is performed, nor are transactions handled. Simply takes a raw query string and returns the database-specific result id.
table()  : BaseBuilder
Returns a non-shared new instance of the query builder for this connection.
tableExists()  : bool
Determine if a particular table exists
transBegin()  : bool
Begin Transaction
transCommit()  : bool
Commit Transaction
transComplete()  : bool
Complete Transaction
transException()  : $this
If set to true, exceptions are thrown during transactions.
transOff()  : void
Disable Transactions
transRollback()  : bool
Rollback Transaction
transStart()  : bool
Start Transaction
transStatus()  : bool
Lets you retrieve the transaction flag to determine if it has failed
transStrict()  : $this
Enable/disable Transaction Strict Mode
_close()  : void
Platform dependent way method for closing the connection.
_disableForeignKeyChecks()  : string
Platform-specific SQL statement to disable foreign key checks.
_enableForeignKeyChecks()  : string
Platform-specific SQL statement to enable foreign key checks.
_escapeString()  : string
Platform independent string escape.
_fieldData()  : array<int, stdClass>
Platform-specific field data information.
_foreignKeyData()  : array<string, stdClass>
Platform-specific foreign keys data.
_indexData()  : array<string, stdClass>
Platform-specific index data.
_listColumns()  : false|string
Generates a platform-specific query string so that the column names can be fetched.
_listTables()  : false|string
Generates the SQL for listing tables in a platform-dependent manner.
_transBegin()  : bool
Begin Transaction
_transCommit()  : bool
Commit Transaction
_transRollback()  : bool
Rollback Transaction
execute()  : false|object|resource
Executes the query against the database.
foreignKeyDataToObjects()  : array<string, stdClass>
Converts array of arrays generated by _foreignKeyData() to array of objects
getDriverFunctionPrefix()  : string
Get the prefix of the function to access the DB.
protectDotItem()  : string

Properties

$aliasedTables read-only

public array<string|int, mixed> $aliasedTables

$connID

Connection ID

public false|object|resource $connID = false
Tags
phpstan-var

false|TConnection

$dataCache

Holds previously looked up data for performance reasons.

public array<string|int, mixed> $dataCache = []

$dateFormat read-only

public array<string|int, mixed> $dateFormat

$escapeChar

Identifier escape character

public array<string|int, mixed>|string $escapeChar = '"'

$likeEscapeChar

ESCAPE character

public string $likeEscapeChar = '!'

$likeEscapeStr

ESCAPE statement string

public string $likeEscapeStr = " ESCAPE '%s' "

$protectIdentifiers

Protect identifiers flag

public bool $protectIdentifiers = true

$reservedIdentifiers read-only

public array<string|int, mixed> $reservedIdentifiers

$resultID

Result ID

public false|object|resource $resultID = false
Tags
phpstan-var

false|TResult

$transEnabled

Transaction enabled flag

public bool $transEnabled = true

$transStrict

Strict transaction mode flag

public bool $transStrict = true

$aliasedTables

Array of table aliases.

protected array<string|int, mixed> $aliasedTables = []

$charset

Character set

protected string $charset = ''

This value must be updated by Config\Database if the driver use it.

$connectDuration

How long it took to establish connection.

protected float $connectDuration = 0.0

$connectTime

Microtime when connection was made

protected float $connectTime = 0.0

$dateFormat

Default Date/Time formats

protected array<string, string> $dateFormat = ['date' => 'Y-m-d', 'datetime' => 'Y-m-d H:i:s', 'datetime-ms' => 'Y-m-d H:i:s.v', 'datetime-us' => 'Y-m-d H:i:s.u', 'time' => 'H:i:s']

$DBCollat

Collation

protected string $DBCollat = ''

This value must be updated by Config\Database if the driver use it.

$DBDebug

Whether to throw Exception or not when an error occurs.

protected bool $DBDebug = true

$DBDriver

Database driver

protected string $DBDriver = 'MySQLi'

$encrypt

Encryption flag/data

protected array<string|int, mixed>|bool $encrypt = false

$failover

Settings for a failover connection.

protected array<string|int, mixed> $failover = []

$lastQuery

The last query object that was executed on this connection.

protected Query $lastQuery

$pConnect

Persistent connection flag

protected bool $pConnect = false

$pregEscapeChar

RegExp used to escape identifiers

protected array<string|int, mixed> $pregEscapeChar = []

$pretend

If true, no queries will actually be run against the database.

protected bool $pretend = false

$queryClass

Query Class

protected string $queryClass = \CodeIgniter\Database\Query::class

$reservedIdentifiers

List of reserved identifiers

protected array<string|int, mixed> $reservedIdentifiers = ['*']

Identifiers that must NOT be escaped.

$strictOn

Strict ON flag

Will move to MySQLi\Connection.

protected bool|null $strictOn

Whether we're running in strict SQL mode.

$subdriver

Sub-driver

protected string $subdriver
Tags
used-by

CI_DB_pdo_driver

$transDepth

Transaction depth level

protected int $transDepth = 0

$transException

Whether to throw exceptions during transaction

protected bool $transException = false

$transFailure

Transaction failure flag

protected bool $transFailure = false

Used with transactions to determine if a transaction has failed.

$transStatus

Transaction status flag

protected bool $transStatus = true

Used with transactions to determine if a rollback should occur.

Methods

__construct()

Saves our connection settings.

public __construct(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

__get()

Accessor for properties if they exist.

public __get(string $key) : array<string|int, mixed>|bool|float|int|object|resource|string|null
Parameters
$key : string
Return values
array<string|int, mixed>|bool|float|int|object|resource|string|null

__isset()

Checker for properties existence.

public __isset(string $key) : bool
Parameters
$key : string
Return values
bool

addTableAlias()

Add a table alias to our list.

public addTableAlias(string $table) : $this
Parameters
$table : string
Return values
$this

affectedRows()

Returns the total number of rows affected by this query.

public abstract affectedRows() : int
Return values
int

callFunction()

This function enables you to call PHP database functions that are not natively included in CodeIgniter, in a platform independent manner.

public callFunction(string $functionName, array<string|int, mixed> ...$params) : array<string|int, mixed>|bool|float|int|object|resource|string|null
Parameters
$functionName : string
$params : array<string|int, mixed>
Tags
throws
DatabaseException
Return values
array<string|int, mixed>|bool|float|int|object|resource|string|null

disableForeignKeyChecks()

Disables foreign key checks temporarily.

public disableForeignKeyChecks() : bool
Return values
bool

enableForeignKeyChecks()

Enables foreign key checks temporarily.

public enableForeignKeyChecks() : bool
Return values
bool

error()

Returns the last error code and message.

public abstract error() : array<string, int|string|null>

Must return an array with keys 'code' and 'message':

Tags
phpstan-return

array{code: int|string|null, message: string|null}

Return values
array<string, int|string|null>

escape()

"Smart" Escape String

public escape(array<string|int, mixed>|bool|float|int|object|string|null $str) : array<string|int, mixed>|float|int|string

Escapes data based on type. Sets boolean and null types

Parameters
$str : array<string|int, mixed>|bool|float|int|object|string|null
Tags
phpstan-return

($str is array ? array : float|int|string)

Return values
array<string|int, mixed>|float|int|string

escapeIdentifier()

Escape the SQL Identifier

public escapeIdentifier(non-empty-string $item) : string

This function escapes single identifier.

Parameters
$item : non-empty-string
Return values
string

escapeIdentifiers()

Escape the SQL Identifiers

public escapeIdentifiers(array<string|int, mixed>|string $item) : array<string|int, mixed>|string

This function escapes column and table names

Parameters
$item : array<string|int, mixed>|string
Tags
phpstan-return

($item is array ? array : string)

Return values
array<string|int, mixed>|string

escapeLikeString()

Escape LIKE String

public escapeLikeString(array<int, string|Stringable>|string|Stringable $str) : array<int, string>|string

Calls the individual driver for platform specific escaping for LIKE conditions

Parameters
$str : array<int, string|Stringable>|string|Stringable
Return values
array<int, string>|string

escapeString()

Escape String

public escapeString(array<int, string|Stringable>|string|Stringable $str[, bool $like = false ]) : array<int, string>|string
Parameters
$str : array<int, string|Stringable>|string|Stringable

Input string

$like : bool = false

Whether the string will be used in a LIKE condition

Return values
array<int, string>|string

fieldExists()

Determine if a particular field exists

public fieldExists(string $fieldName, string $tableName) : bool
Parameters
$fieldName : string
$tableName : string
Return values
bool

getConnectDuration()

Returns the number of seconds with microseconds that it took to connect to the database.

public getConnectDuration([int $decimals = 6 ]) : string

Used by the Debug Toolbar's timeline.

Parameters
$decimals : int = 6
Return values
string

getConnection()

Returns the actual connection object. If both a 'read' and 'write' connection has been specified, you can pass either term in to get that connection. If you pass either alias in and only a single connection is present, it must return the sole connection.

public getConnection([string|null $alias = null ]) : false|object|resource
Parameters
$alias : string|null = null
Tags
phpstan-return

TConnection

Return values
false|object|resource

getConnectStart()

Returns the time we started to connect to this database in seconds with microseconds.

public getConnectStart() : float|null

Used by the Debug Toolbar's timeline.

Return values
float|null

getDatabase()

Returns the name of the current database being used.

public getDatabase() : string
Return values
string

getFieldData()

Returns an object with field data

public getFieldData(string $table) : array<int, stdClass>
Parameters
$table : string
Return values
array<int, stdClass>

getFieldNames()

Fetch Field Names

public getFieldNames(string $table) : false|array<int, string>
Parameters
$table : string
Tags
throws
DatabaseException
Return values
false|array<int, string>

getForeignKeyData()

Returns an object with foreign key data

public getForeignKeyData(string $table) : array<string, stdClass>
Parameters
$table : string
Return values
array<string, stdClass>

getIndexData()

Returns an object with key data

public getIndexData(string $table) : array<string, stdClass>
Parameters
$table : string
Return values
array<string, stdClass>

getPlatform()

The name of the platform in use (MySQLi, Postgre, SQLite3, OCI8, etc)

public getPlatform() : string
Return values
string

getPrefix()

Returns the database prefix.

public getPrefix() : string
Return values
string

insertID()

Insert ID

public abstract insertID() : int|string
Return values
int|string

isWriteType()

Determines if the statement is a write-type query or not.

public isWriteType(string $sql) : bool
Parameters
$sql : string
Return values
bool

listTables()

Returns an array of table names

public listTables([bool $constrainByPrefix = false ]) : false|array<int, string>
Parameters
$constrainByPrefix : bool = false
Tags
throws
DatabaseException
Return values
false|array<int, string>

persistentConnect()

Create a persistent database connection.

public persistentConnect() : false|object|resource
Tags
phpstan-return

false|TConnection

Return values
false|object|resource

prefixTable()

Prepends a database prefix if one exists in configuration

public prefixTable([string $table = '' ]) : string
Parameters
$table : string = ''
Tags
throws
DatabaseException
Return values
string

prepare()

Creates a prepared statement with the database that can then be used to execute multiple statements against. Within the closure, you would build the query in any normal way, though the Query Builder is the expected manner.

public prepare(Closure $func[, array<string|int, mixed> $options = [] ]) : BasePreparedQuery|null

Example: $stmt = $db->prepare(function($db) { return $db->table('users') ->where('id', 1) ->get(); })

Parameters
$func : Closure
$options : array<string|int, mixed> = []
Return values
BasePreparedQuery|null

pretend()

Allows the engine to be set into a mode where queries are not actually executed, but they are still generated, timed, etc.

public pretend([bool $pretend = true ]) : $this

This is primarily used by the prepared query functionality.

Parameters
$pretend : bool = true
Return values
$this

protectIdentifiers()

Protect Identifiers

public protectIdentifiers(array<string|int, mixed>|int|string $item[, bool $prefixSingle = false ][, bool $protectIdentifiers = null ][, bool $fieldExists = true ]) : array<string|int, mixed>|string

This function is used extensively by the Query Builder class, and by a couple functions in this class. It takes a column or table name (optionally with an alias) and inserts the table prefix onto it. Some logic is necessary in order to deal with column names that include the path. Consider a query like this:

SELECT hostname.database.table.column AS c FROM hostname.database.table

Or a query with aliasing:

SELECT m.member_id, m.member_name FROM members AS m

Since the column name can include up to four segments (host, DB, table, column) or also have an alias prefix, we need to do a bit of work to figure this out and insert the table prefix (if it exists) in the proper position, and escape only the correct identifiers.

Parameters
$item : array<string|int, mixed>|int|string
$prefixSingle : bool = false

Prefix a table name with no segments?

$protectIdentifiers : bool = null

Protect table or column names?

$fieldExists : bool = true

Supplied $item contains a column name?

Tags
phpstan-return

($item is array ? array : string)

Return values
array<string|int, mixed>|string

query()

Orchestrates a query against the database. Queries must use Database\Statement objects to store the query and build it.

public query(string $sql[, array<string|int, mixed>|string|null $binds = null ][, bool $setEscapeFlags = true ][, string $queryClass = '' ]) : BaseResult|bool|Query

This method works with the cache.

Should automatically handle different connections for read/write queries if needed.

Parameters
$sql : string
$binds : array<string|int, mixed>|string|null = null
$setEscapeFlags : bool = true
$queryClass : string = ''
Tags
phpstan-return

BaseResult<TConnection, TResult>|bool|Query

todo

BC set $queryClass default as null in 4.1

Return values
BaseResult|bool|Query

BaseResult when “read” type query, bool when “write” type query, Query when prepared query

resetDataCache()

Empties our data cache. Especially helpful during testing.

public resetDataCache() : $this
Return values
$this

setAliasedTables()

Sets the Table Aliases to use. These are typically collected during use of the Builder, and set here so queries are built correctly.

public setAliasedTables(array<string|int, mixed> $aliases) : $this
Parameters
$aliases : array<string|int, mixed>
Return values
$this

setPrefix()

Set DB Prefix

public setPrefix([string $prefix = '' ]) : string

Set's the DB Prefix to something new without needing to reconnect

Parameters
$prefix : string = ''

The prefix

Return values
string

showLastQuery()

Returns a string representation of the last query's statement object.

public showLastQuery() : string
Return values
string

simpleQuery()

Performs a basic query against the database. No binding or caching is performed, nor are transactions handled. Simply takes a raw query string and returns the database-specific result id.

public simpleQuery(string $sql) : false|object|resource
Parameters
$sql : string
Tags
phpstan-return

false|TResult

Return values
false|object|resource

table()

Returns a non-shared new instance of the query builder for this connection.

public table(array<string|int, mixed>|string $tableName) : BaseBuilder
Parameters
$tableName : array<string|int, mixed>|string
Tags
throws
DatabaseException
Return values
BaseBuilder

tableExists()

Determine if a particular table exists

public tableExists(string $tableName[, bool $cached = true ]) : bool
Parameters
$tableName : string
$cached : bool = true

Whether to use data cache

Return values
bool

transBegin()

Begin Transaction

public transBegin([bool $testMode = false ]) : bool
Parameters
$testMode : bool = false
Return values
bool

transCommit()

Commit Transaction

public transCommit() : bool
Return values
bool

transComplete()

Complete Transaction

public transComplete() : bool
Return values
bool

transException()

If set to true, exceptions are thrown during transactions.

public transException(bool $transException) : $this
Parameters
$transException : bool
Return values
$this

transOff()

Disable Transactions

public transOff() : void

This permits transactions to be disabled at run-time.

transRollback()

Rollback Transaction

public transRollback() : bool
Return values
bool

transStart()

Start Transaction

public transStart([bool $testMode = false ]) : bool
Parameters
$testMode : bool = false
Return values
bool

transStatus()

Lets you retrieve the transaction flag to determine if it has failed

public transStatus() : bool
Return values
bool

transStrict()

Enable/disable Transaction Strict Mode

public transStrict([bool $mode = true ]) : $this

When strict mode is enabled, if you are running multiple groups of transactions, if one group fails all subsequent groups will be rolled back.

If strict mode is disabled, each group is treated autonomously, meaning a failure of one group will not affect any others

Parameters
$mode : bool = true

= true

Return values
$this

_close()

Platform dependent way method for closing the connection.

protected abstract _close() : void

_disableForeignKeyChecks()

Platform-specific SQL statement to disable foreign key checks.

protected _disableForeignKeyChecks() : string

If this feature is not supported, return empty string.

Tags
TODO

This method should be moved to an interface that represents foreign key support.

see
disableForeignKeyChecks()
Return values
string

_enableForeignKeyChecks()

Platform-specific SQL statement to enable foreign key checks.

protected _enableForeignKeyChecks() : string

If this feature is not supported, return empty string.

Tags
TODO

This method should be moved to an interface that represents foreign key support.

see
enableForeignKeyChecks()
Return values
string

_escapeString()

Platform independent string escape.

protected _escapeString(string $str) : string

Will likely be overridden in child classes.

Parameters
$str : string
Return values
string

_fieldData()

Platform-specific field data information.

protected abstract _fieldData(string $table) : array<int, stdClass>
Parameters
$table : string
Tags
see
getFieldData()
Return values
array<int, stdClass>

_foreignKeyData()

Platform-specific foreign keys data.

protected abstract _foreignKeyData(string $table) : array<string, stdClass>
Parameters
$table : string
Tags
see
getForeignKeyData()
Return values
array<string, stdClass>

_indexData()

Platform-specific index data.

protected abstract _indexData(string $table) : array<string, stdClass>
Parameters
$table : string
Tags
see
getIndexData()
Return values
array<string, stdClass>

_listColumns()

Generates a platform-specific query string so that the column names can be fetched.

protected abstract _listColumns([string $table = '' ]) : false|string
Parameters
$table : string = ''
Return values
false|string

_listTables()

Generates the SQL for listing tables in a platform-dependent manner.

protected abstract _listTables([bool $constrainByPrefix = false ][, string|null $tableName = null ]) : false|string
Parameters
$constrainByPrefix : bool = false
$tableName : string|null = null

If $tableName is provided will return only this table if exists.

Return values
false|string

_transBegin()

Begin Transaction

protected abstract _transBegin() : bool
Return values
bool

_transCommit()

Commit Transaction

protected abstract _transCommit() : bool
Return values
bool

_transRollback()

Rollback Transaction

protected abstract _transRollback() : bool
Return values
bool

execute()

Executes the query against the database.

protected abstract execute(string $sql) : false|object|resource
Parameters
$sql : string
Tags
phpstan-return

false|TResult

Return values
false|object|resource

foreignKeyDataToObjects()

Converts array of arrays generated by _foreignKeyData() to array of objects

protected foreignKeyDataToObjects(array<string|int, mixed> $data) : array<string, stdClass>
Parameters
$data : array<string|int, mixed>
Return values
array<string, stdClass>

array[ {constraint_name} => stdClass[ 'constraint_name' => string, 'table_name' => string, 'column_name' => string[], 'foreign_table_name' => string, 'foreign_column_name' => string[], 'on_delete' => string, 'on_update' => string, 'match' => string ] ]

getDriverFunctionPrefix()

Get the prefix of the function to access the DB.

protected getDriverFunctionPrefix() : string
Return values
string

protectDotItem()

private protectDotItem(string $item, string $alias, bool $protectIdentifiers, bool $fieldExists) : string
Parameters
$item : string
$alias : string
$protectIdentifiers : bool
$fieldExists : bool
Return values
string

        
On this page

Search results