EC-CUBE
Public メソッド | 変数
クラス MDB2_Driver_mysql
MDB2_Driver_mysqlに対する継承グラフ
Inheritance graph
[凡例]
MDB2_Driver_mysqlのコラボレーション図
Collaboration graph
[凡例]

Public メソッド

 __construct ()
 _reCheckSupportedOptions ()
 setOption ($option, $value)
 errorInfo ($error=null)
 escape ($text, $escape_wildcards=false)
 beginTransaction ($savepoint=null)
 commit ($savepoint=null)
 rollback ($savepoint=null)
 setTransactionIsolation ($isolation)
 _doConnect ($username, $password, $persistent=false)
 connect ()
 setCharset ($charset, $connection=null)
 databaseExists ($name)
 disconnect ($force=true)
standaloneQuery ($query, $types=null, $is_manip=false)
_doQuery ($query, $is_manip=false, $connection=null, $database_name=null)
 _affectedRows ($connection, $result=null)
 _modifyQuery ($query, $is_manip, $limit, $offset)
 getServerVersion ($native=false)
 _getServerCapabilities ()
 _skipUserDefinedVariable ($query, $position)
prepare ($query, $types=null, $result_types=null, $lobs=array())
 replace ($table, $fields)
 nextID ($seq_name, $ondemand=true)
 lastInsertID ($table=null, $field=null)
 currID ($seq_name)

変数

 $string_quoting = array('start' => "'", 'end' => "'", 'escape' => '\\', 'escape_pattern' => '\\')
 $identifier_quoting = array('start' => '`', 'end' => '`', 'escape' => '`')
 $sql_comments
 $server_capabilities_checked = false
 $start_transaction = false
 $varchar_max_length = 255

コンストラクタとデストラクタ

Constructor

MDB2_Driver_Commonを再定義しています。


関数

_affectedRows ( connection,
result = null 
)

Returns the number of rows affected

引数:
resource$result
resource$connection
戻り値:
mixed MDB2 Error Object or the number of rows affected private

MDB2_Driver_Commonを再定義しています。

_doConnect ( username,
password,
persistent = false 
)

do the grunt work of the connect

戻り値:
connection on success or MDB2 Error Object on failure protected
& _doQuery ( query,
is_manip = false,
connection = null,
database_name = null 
)

Execute a query

引数:
string$queryquery
boolean$is_manipif the query is a manipulation query
resource$connection
string$database_name
戻り値:
result or error object protected

MDB2_Driver_Commonを再定義しています。

Fetch some information about the server capabilities (transactions, subselects, prepared statements, etc).

private

_modifyQuery ( query,
is_manip,
limit,
offset 
)

Changes a query string for various DBMS specific reasons

引数:
string$queryquery to modify
boolean$is_manipif it is a DML query
integer$limitlimit the number of rows
integer$offsetstart reading from given offset
戻り値:
string modified query protected

MDB2_Driver_Commonを再定義しています。

If the user changes certain options, other capabilities may depend on the new settings, so we need to check them (again).

private

_skipUserDefinedVariable ( query,
position 
)

Utility method, used by prepare() to avoid misinterpreting MySQL user defined variables (SELECT :=5) for placeholders. Check if the placeholder is a false positive, i.e. if it is an user defined variable instead. If so, skip it and advance the position, otherwise return the current position, which is valid

引数:
string$query
integer$positioncurrent string cursor position
戻り値:
integer $new_position protected
beginTransaction ( savepoint = null)

Start a transaction or set a savepoint.

引数:
stringname of a savepoint to set
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure

public

MDB2_Driver_Commonを再定義しています。

commit ( savepoint = null)

Commit the database changes done during a transaction that is in progress or release a savepoint. This function may only be called when auto-committing is disabled, otherwise it will fail. Therefore, a new transaction is implicitly started after committing the pending changes.

引数:
stringname of a savepoint to release
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure

public

MDB2_Driver_Commonを再定義しています。

connect ( )

Connect to the database

戻り値:
MDB2_OK on success, MDB2 Error Object on failure public

MDB2_Driver_Commonを再定義しています。

currID ( seq_name)

Returns the current id of a sequence

引数:
string$seq_namename of the sequence
戻り値:
mixed MDB2 Error Object or id public

MDB2_Driver_Commonを再定義しています。

databaseExists ( name)

check if given database name is exists?

引数:
string$namename of the database that should be checked
戻り値:
mixed true/false on success, a MDB2 error on failure public

MDB2_Driver_Commonを再定義しています。

disconnect ( force = true)

Log out and disconnect from the database.

引数:
boolean$forceif the disconnect should be forced even if the connection is opened persistently
戻り値:
mixed true on success, false if not connected and error object on error public

MDB2_Driver_Commonを再定義しています。

errorInfo ( error = null)

This method is used to collect information about an error

引数:
integer$error
戻り値:
array public

MDB2_Driver_Commonを再定義しています。

escape ( text,
escape_wildcards = false 
)

Quotes a string so it can be safely used in a query. It will quote the text so it can safely be used within a query.

引数:
stringthe input string to quote
boolescape wildcards
戻り値:
string quoted string

public

MDB2_Driver_Commonを再定義しています。

getServerVersion ( native = false)

return version information about the server

引数:
bool$nativedetermines if the raw version string should be returned
戻り値:
mixed array/string with version information or MDB2 error object public

MDB2_Driver_Commonを再定義しています。

lastInsertID ( table = null,
field = null 
)

Returns the autoincrement ID if supported or $id or fetches the current ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)

引数:
string$tablename of the table into which a new row was inserted
string$fieldname of the field into which a new row was inserted
戻り値:
mixed MDB2 Error Object or id public

MDB2_Driver_Commonを再定義しています。

nextID ( seq_name,
ondemand = true 
)

Returns the next free id of a sequence

引数:
string$seq_namename of the sequence
boolean$ondemandwhen true the sequence is automatic created, if it not exists
戻り値:
mixed MDB2 Error Object or id public

MDB2_Driver_Commonを再定義しています。

& prepare ( query,
types = null,
result_types = null,
lobs = array() 
)

Prepares a query for multiple execution with execute(). With some database backends, this is emulated. prepare() requires a generic query as string like 'INSERT INTO numbers VALUES(?,?)' or 'INSERT INTO numbers VALUES(:foo,:bar)'. The ? and :name and are placeholders which can be set using bindParam() and the query can be sent off using the execute() method. The allowed format for :name can be set with the 'bindname_format' option.

引数:
string$querythe query to prepare
mixed$typesarray that contains the types of the placeholders
mixed$result_typesarray that contains the types of the columns in the result set or MDB2_PREPARE_RESULT, if set to MDB2_PREPARE_MANIP the query is handled as a manipulation query
mixed$lobskey (field) value (parameter) pair for all lob placeholders
戻り値:
mixed resource handle for the prepared query on success, a MDB2 error on failure public
参照:
bindParam, execute

MDB2_Driver_Commonを再定義しています。

replace ( table,
fields 
)

Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT query, except that if there is already a row in the table with the same key field values, the old row is deleted before the new row is inserted.

The REPLACE type of query does not make part of the SQL standards. Since practically only MySQL implements it natively, this type of query is emulated through this method for other DBMS using standard types of queries inside a transaction to assure the atomicity of the operation.

public

引数:
string$tablename of the table on which the REPLACE query will be executed.
array$fieldsassociative array that describes the fields and the values that will be inserted or updated in the specified table. The indexes of the array are the names of all the fields of the table. The values of the array are also associative arrays that describe the values and other properties of the table fields.

Here follows a list of field properties that need to be specified:

value: Value to be assigned to the specified field. This value may be of specified in database independent type format as this function can perform the necessary datatype conversions.

Default: this property is required unless the Null property is set to 1.

type Name of the type of the field. Currently, all types Metabase are supported except for clob and blob.

Default: no type conversion

null Boolean property that indicates that the value for this field should be set to null.

The default value for fields missing in INSERT queries may be specified the definition of a table. Often, the default value is already null, but since the REPLACE may be emulated using an UPDATE query, make sure that all fields of the table are listed in this function argument array.

Default: 0

key Boolean property that indicates that this field should be handled as a primary key or at least as part of the compound unique index of the table that will determine the row that will updated if it exists or inserted a new row otherwise.

This function will fail if no key field is specified or if the value of a key field is set to null because fields that are part of unique index they may not be null.

Default: 0

参照:
http://dev.mysql.com/doc/refman/5.0/en/replace.html
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure

MDB2_Driver_Commonを再定義しています。

rollback ( savepoint = null)

Cancel any database changes done during a transaction or since a specific savepoint that is in progress. This function may only be called when auto-committing is disabled, otherwise it will fail. Therefore, a new transaction is implicitly started after canceling the pending changes.

引数:
stringname of a savepoint to rollback to
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure

public

MDB2_Driver_Commonを再定義しています。

setCharset ( charset,
connection = null 
)

Set the charset on the current connection

引数:
stringcharset (or array(charset, collation))
resourceconnection handle
戻り値:
true on success, MDB2 Error Object on failure

MDB2_Driver_Commonを再定義しています。

setOption ( option,
value 
)

set the option for the db class

引数:
stringoption name
mixedvalue for the option
戻り値:
mixed MDB2_OK or MDB2 Error Object

public

MDB2_Driver_Commonを再定義しています。

setTransactionIsolation ( isolation)

Set the transacton isolation level.

引数:
stringstandard isolation level READ UNCOMMITTED (allows dirty reads) READ COMMITTED (prevents dirty reads) REPEATABLE READ (prevents nonrepeatable reads) SERIALIZABLE (prevents phantom reads)
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure

public

から:
2.1.1
& standaloneQuery ( query,
types = null,
is_manip = false 
)

execute a query as DBA

引数:
string$querythe SQL query
mixed$typesarray that contains the types of the columns in the result set
boolean$is_manipif the query is a manipulation query
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Commonを再定義しています。


構造体

$sql_comments
初期値:
 array(
        array('start' => '-- ', 'end' => "\n", 'escape' => false),
        array('start' => '#', 'end' => "\n", 'escape' => false),
        array('start' => '/*', 'end' => '*/', 'escape' => false),
    )

MDB2_Driver_Commonを再定義しています。


このクラスの説明は次のファイルから生成されました:
 全て データ構造 ネームスペース 関数 変数