Class odbc
ODBC storage driver.
- Core\Object implements Core\Chainable
- Core\Set implements Core\Accessor
- Core\Storage
- Core\Storage\Driver\odbc
Package: Core\Storage
Since: 3.1
Requires: PHP 5.3, ODBC
Version: 1.0
Located at Storage/Driver/odbc.inc.php
Methods summary
public
|
|
public
|
|
public
|
|
public static
string
|
#
sqlLong2State( integer $encodedCode )
ODBC uses alphanumeric state codes. This method converts a previously numerically encoded code back to the ODBC state code. |
public static
integer
|
#
sqlState2Long( string $stateCode )
ODBC uses alphanumeric state codes. This method converts an ODBC state code into a numerical representation such that it can be used as an error code for PHP exceptions. |
public
string
|
#
backendVersion( )
Returns the back-end version string. Some drivers use different layers for their backend storage (e.g. an interface library and a server) with different versions for each layer. The most basic layer, available and significant version is returned (e.g. the database server version). |
public
Transaction
|
|
public
string
|
#
clientVersion( )
Returns the client version string. Some drivers use different layers for their back-end storage (e.g. an interface library and a server) with different versions for each layer. The highest layer, available and significant version is returned (e.g. the database client version). |
public
|
|
public
string
|
#
escape( string $value, boolean $addDelimiters = false )
Escapes a binary string specific to the storage back-end for direct usage. When performing direct commands on the back-end engine, most storage systems require the user to escaped data sequences (e.g. SQL). Each data sequence used for direct commands should therefore be preprocessed by this method prior to sending the command. |
public
Storage_Result
|
#
execute( mixed $statement, array $parameters = null )
Executes an accessor node, prepared storage statement or direct back-end query. |
public
|
|
public
|
#
reset( )
Closes and reopens the ODBC database connection. If no connection is open, no action is performed. |
public
|
#
rollback( $transactionID = null )
Cancels the currently active transaction.
The ODBC extension for PHP does not natively support nested transactions,
hence reverting back to any other index than 1 (or the default |
public static
integer
|
#
unifyErrorCode( integer $code )
Translates an ODBC-specific error code into the unified error codes used by Core Storage. |
Methods inherited from Core\Storage
Methods inherited from Core\Object
__autocreateFactory()
,
__call()
,
__processParameters()
,
__toString()
,
attachMethod()
,
chain()
,
getValueForKey()
,
getValueForKeyPath()
,
getValueForUndefinedKey()
,
hash()
,
issetValueForKey()
,
setValueForKey()
,
setValueForKeyPath()
,
setValueForUndefinedKey()
,
uuid()
Constants summary
string |
EmulateBindingsParameter
Whether to emulate bindings. Useful for ODBC back-ends that do not support parameter binding, such as MS Access. |
#
'emulate-bindings'
|
string |
IndexModeParameter
Index mode parameter name. |
#
'index'
|
string |
NumericIndexMode
Index modes that uses numeric indices for result columns. Column names are ignored. Slightly reduces memory overhead. |
#
'numeric'
|
string |
AssociativeIndexMode
Index mode that uses associative indices for result columns. Indices are based on the table column name or selection expression. This is the default. |
#
'assoc'
|
Constants inherited from Core\Storage
Constants inherited from Core\Object
AnyParameterType
,
AutochainParameterType
,
AutocreateParameterType
,
BooleanParameterType
,
CharParameterType
,
EnumParameterType
,
IntegerParameterType
,
RealParameterType
,
StringParameterType
,
UserParameterType
Properties summary
protected
array
|
$_v_odbcParameters
Raw ODBC connection configuration parameters passed to back-end driver. |
|
protected
array
|
$_v_parameters
Cached driver configuration array. |
|
protected
integer
|
$_v_transactionCounter
Nested transactions counter. |
|
protected
|
$_v_uri
Driver configuration URI. Required for re-connecting to the database. |
|
protected
resource
|
$_connection
ODBC connection. |
Properties inherited from Core\Storage
Magic properties
public read-only
array
|
$odbcParameters
Raw ODBC connection parameters passed to back-end driver. |
public read-only
array
|
$parameters
Cached driver configuration array. |
public read-only
integer
|
$transactionCounter
Counter for nested transactions. |
public read-only
|
$uri
Driver configuration URI. |