Utilities
in package
Table of Contents
Methods
- getAttributes() : string
- Retrieves the attributes for a given attribute name.
- getDataType() : int
- Returns the data type of the given value.
- interpolateQuery() : string
- Interpolates the given query string with the provided placeholders.
- isSqlAutoCommit() : bool
- test if the SQL query accepts transaction or if it's an auto-commited query https://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html
Methods
getAttributes()
Retrieves the attributes for a given attribute name.
public
static getAttributes(string $attr) : string
Parameters
- $attr : string
-
The name of the attribute.
Return values
string —The value of the attribute
getDataType()
Returns the data type of the given value.
public
static getDataType(mixed $value) : int
Parameters
- $value : mixed
-
The value to determine the data type of.
Return values
int —The data type of the value.
interpolateQuery()
Interpolates the given query string with the provided placeholders.
public
static interpolateQuery(string $queryString, array<int|string, mixed> $placeholders) : string
Parameters
- $queryString : string
-
The query string to be interpolated.
- $placeholders : array<int|string, mixed>
-
An associative array of placeholders and their corresponding values.
Return values
string —The interpolated query string.
isSqlAutoCommit()
test if the SQL query accepts transaction or if it's an auto-commited query https://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html
public
static isSqlAutoCommit(string $sql) : bool
Parameters
- $sql : string