OBJECT
OBJECT
The MYSQL Adapter class
This class is the sql adapter for MySQL.
getInstance(string $name = null) : \Orpheus\SQLAdapter\SQLAdapter
Get an unique instance of SQLAdapter by its name
string | $name | Name of the instance, default value is "default" |
make(string $name = 'default') : \Orpheus\SQLAdapter\SQLAdapter
Try to make a SQLAdapter by its name loading from configuration
string | $name |
formatValue(string $value) : \Orpheus\SQLAdapter\The
Format SQL value
string | $value | The value to format. |
formatted value.
Format the given value to the matching SQL type. If the value is a float, we make french decimal compatible with SQL. If null, we use the NULL value, else we consider it as a string value.
setIDField(string $field) : \Orpheus\SQLAdapter\SQLAdapter
Set the IDFIELD
string | $field | The new ID field. |
Set the IDFIELD value to $field
doSelect(array $options = array(), string $instance = null, string $IDField = null)
The static function to use for SELECT queries in global context
array | $options | The options used to build the query. |
string | $instance | The db instance used to send the query. |
string | $IDField | The ID field of the table. |
doUpdate( $options = array(), $instance = null, $IDField = null)
The static function to use for UPDATE queries in global context
$options | The options used to build the query. |
|
$instance | The db instance used to send the query. |
|
$IDField | The ID field of the table. |
None found |
doDelete( $options = array(), $instance = null, $IDField = null)
The static function to use for DELETE queries in global context
$options | The options used to build the query. |
|
$instance | The db instance used to send the query. |
|
$IDField | The ID field of the table. |
None found |
doInsert( $options = array(), $instance = null, $IDField = null)
The static function to use for INSERT queries in global context
$options | The options used to build the query. |
|
$instance | The db instance used to send the query. |
|
$IDField | The ID field of the table. |
None found |
doLastID( $table, $IDField = 'id', $instance = null)
The static function to use to get last isnert id in global context
$table | The table to get the last ID. Some DBMS ignore it. |
|
$IDField | The field id name. |
|
$instance | The db instance used to send the query. |
None found |
doEscapeIdentifier( $Identifier, $instance = null) : \Orpheus\SQLAdapter\The
Escapes SQL identifiers
$Identifier | The identifier to escape. |
|
$instance | The db instance used to send the query. |
escaped identifier.
None found |
doFormatString( $String, $instance = null) : \Orpheus\SQLAdapter\The
Escapes SQL identifiers
$String | The value to format. |
|
$instance | The db instance used to send the query. |
formatted value.
None found |
doFormatValue(string $value, $instance = null) : \Orpheus\SQLAdapter\The
The static function to quote
string | $value | The string to quote. |
$instance | The db instance used to send the query. |
quoted string.
None found |
prepareQuery( $options = array(), $instance = null, $IDField = null)
Prepare the query for the given instance
$options | The options used to build the query. |
|
$instance | The db instance used to send the query. |
|
$IDField | The ID field of the table. |
None found |
prepareInstance( $instance = null)
The static function to prepareInstance an adapter for the given instance
$instance | The db instance name to prepareInstance. |
None found |
registerInstance(string $name, \Orpheus\SQLAdapter\SQLAdapter $adapter)
Register an unique instance by its name
string | $name | |
\Orpheus\SQLAdapter\SQLAdapter | $adapter |
None found |
getDefaults() : array<mixed,string>
Get defaults configuration to fill missing options
None found |
None found |
formatFieldList(array|string $fields) : string
Format the given $fields into an escaped SQL string list of key=value
array|string | $fields |
None found |