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

Public メソッド

 createDatabase ($name, $options=array())
 alterDatabase ($name, $options=array())
 dropDatabase ($name)
 _getAdvancedFKOptions ($definition)
 createTable ($name, $fields, $options=array())
 dropTable ($name)
 truncateTable ($name)
 vacuum ($table=null, $options=array())
 alterTable ($name, $changes, $check)
 listDatabases ()
 listUsers ()
 listFunctions ()
 listTableTriggers ($table=null)
 listTables ($database=null)
 listViews ($database=null)
 listTableFields ($table)
 createIndex ($table, $name, $definition)
 dropIndex ($table, $name)
 listTableIndexes ($table)
 createConstraint ($table, $name, $definition)
 dropConstraint ($table, $name, $primary=false)
 _createFKTriggers ($table, $foreign_keys)
 _dropFKTriggers ($table, $fkname, $referenced_table)
 listTableConstraints ($table)
 createSequence ($seq_name, $start=1, $options=array())
 dropSequence ($seq_name)
 listSequences ($database=null)

関数

_createFKTriggers ( table,
foreign_keys 
)

Create triggers to enforce the FOREIGN KEY constraint on the table

NB: since there's no RAISE_APPLICATION_ERROR facility in mysql, we call a non-existent procedure to raise the FK violation message.

参照:
http://forums.mysql.com/read.php?99,55108,71877#msg-71877
引数:
string$tabletable name
array$foreign_keysFOREIGN KEY definitions
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure private
_dropFKTriggers ( table,
fkname,
referenced_table 
)

Drop the triggers created to enforce the FOREIGN KEY constraint on the table

引数:
string$tabletable name
string$fknameFOREIGN KEY constraint name
string$referenced_tablereferenced table name
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure private
_getAdvancedFKOptions ( definition)

Return the FOREIGN KEY query section dealing with non-standard options as MATCH, INITIALLY DEFERRED, ON UPDATE, ...

引数:
array$definition
戻り値:
string protected

MDB2_Driver_Manager_Commonを再定義しています。

alterDatabase ( name,
options = array() 
)

alter an existing database

引数:
string$namename of the database that is intended to be changed
array$optionsarray with charset, collation info
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

alterTable ( name,
changes,
check 
)

alter an existing table

引数:
string$namename of the table that is intended to be changed.
array$changesassociative array that contains the details of each type of change that is intended to be performed. The types of changes that are currently supported are defined as follows:

name

New name for the table.

add

Associative array with the names of fields to be added as indexes of the array. The value of each entry of the array should be set to another associative array with the properties of the fields to be added. The properties of the fields should be the same as defined by the MDB2 parser.

remove

Associative array with the names of fields to be removed as indexes of the array. Currently the values assigned to each entry are ignored. An empty array should be used for future compatibility.

rename

Associative array with the names of fields to be renamed as indexes of the array. The value of each entry of the array should be set to another associative array with the entry named name with the new field name and the entry named Declaration that is expected to contain the portion of the field declaration already in DBMS specific SQL code as it is used in the CREATE TABLE statement.

change

Associative array with the names of the fields to be changed as indexes of the array. Keep in mind that if it is intended to change either the name of a field and any other properties, the change array entries should have the new names of the fields as array indexes.

The value of each entry of the array should be set to another associative array with the properties of the fields to that are meant to be changed as array entries. These entries should be assigned to the new values of the respective properties. The properties of the fields should be the same as defined by the MDB2 parser.

Example array( 'name' => 'userlist', 'add' => array( 'quota' => array( 'type' => 'integer', 'unsigned' => 1 ) ), 'remove' => array( 'file_limit' => array(), 'time_limit' => array() ), 'change' => array( 'name' => array( 'length' => '20', 'definition' => array( 'type' => 'text', 'length' => 20, ), ) ), 'rename' => array( 'sex' => array( 'name' => 'gender', 'definition' => array( 'type' => 'text', 'length' => 1, 'default' => 'M', ), ) ) )

引数:
boolean$checkindicates whether the function should just check if the DBMS driver can perform the requested table alterations if the value is true or actually perform them otherwise. public
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure

MDB2_Driver_Manager_Commonを再定義しています。

createConstraint ( table,
name,
definition 
)

create a constraint on a table

引数:
string$tablename of the table on which the constraint is to be created
string$namename of the constraint to be created
array$definitionassociative array that defines properties of the constraint to be created. Currently, only one property named FIELDS is supported. This property is also an associative with the names of the constraint fields as array constraints. Each entry of this array is set to another type of associative array that specifies properties of the constraint that are specific to each field.

Example array( 'fields' => array( 'user_name' => array(), 'last_login' => array() ) )

戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

createDatabase ( name,
options = array() 
)

create a new database

引数:
string$namename of the database that should be created
array$optionsarray with charset, collation info
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

createIndex ( table,
name,
definition 
)

Get the stucture of a field into an array

作者:
Leoncx
引数:
string$tablename of the table on which the index is to be created
string$namename of the index to be created
array$definitionassociative array that defines properties of the index to be created. Currently, only one property named FIELDS is supported. This property is also an associative with the names of the index fields as array indexes. Each entry of this array is set to another type of associative array that specifies properties of the index that are specific to each field.

Currently, only the sorting property is supported. It should be used to define the sorting direction of the index. It may be set to either ascending or descending.

Not all DBMS support index sorting direction configuration. The DBMS drivers of those that do not support it ignore this property. Use the function supports() to determine whether the DBMS driver can manage indexes.

Example array( 'fields' => array( 'user_name' => array( 'sorting' => 'ascending' 'length' => 10 ), 'last_login' => array() ) )

戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

createSequence ( seq_name,
start = 1,
options = array() 
)

create sequence

引数:
string$seq_namename of the sequence to be created
string$startstart value of the sequence; default is 1
array$optionsAn associative array of table options: array( 'comment' => 'Foo', 'charset' => 'utf8', 'collate' => 'utf8_unicode_ci', 'type' => 'innodb', );
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public
createTable ( name,
fields,
options = array() 
)

create a new table

引数:
string$nameName of the database that should be created
array$fieldsAssociative array that contains the definition of each field of the new table The indexes of the array entries are the names of the fields of the table an the array entry values are associative arrays like those that are meant to be passed with the field definitions to get[Type]Declaration() functions. array( 'id' => array( 'type' => 'integer', 'unsigned' => 1 'notnull' => 1 'default' => 0 ), 'name' => array( 'type' => 'text', 'length' => 12 ), 'password' => array( 'type' => 'text', 'length' => 12 ) );
array$optionsAn associative array of table options: array( 'comment' => 'Foo', 'charset' => 'utf8', 'collate' => 'utf8_unicode_ci', 'type' => 'innodb', );
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

dropConstraint ( table,
name,
primary = false 
)

drop existing constraint

引数:
string$tablename of table that should be used in method
string$namename of the constraint to be dropped
string$primaryhint if the constraint is primary
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

dropDatabase ( name)

drop an existing database

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

MDB2_Driver_Manager_Commonを再定義しています。

dropIndex ( table,
name 
)

drop existing index

引数:
string$tablename of table that should be used in method
string$namename of the index to be dropped
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

dropSequence ( seq_name)

drop existing sequence

引数:
string$seq_namename of the sequence to be dropped
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

dropTable ( name)

drop an existing table

引数:
string$namename of the table that should be dropped
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

list all databases

戻り値:
mixed array of database names on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

list all functions in the current database

戻り値:
mixed array of function names on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

listSequences ( database = null)

list all sequences in the current database

引数:
stringdatabase, the current is default
戻り値:
mixed array of sequence names on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

listTableConstraints ( table)

list all constraints in a table

引数:
string$tablename of table that should be used in method
戻り値:
mixed array of constraint names on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

listTableFields ( table)

list all fields in a table in the current database

引数:
string$tablename of table that should be used in method
戻り値:
mixed array of field names on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

listTableIndexes ( table)

list all indexes in a table

引数:
string$tablename of table that should be used in method
戻り値:
mixed array of index names on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

listTables ( database = null)

list all tables in the current database

引数:
stringdatabase, the current is default
戻り値:
mixed array of table names on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

listTableTriggers ( table = null)

list all triggers in the database that reference a given table

引数:
stringtable for which all referenced triggers should be found
戻り値:
mixed array of trigger names on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

listUsers ( )

list all users

戻り値:
mixed array of user names on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

listViews ( database = null)

list all views in the current database

引数:
stringdatabase, the current is default
戻り値:
mixed array of view names on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

truncateTable ( name)

Truncate an existing table (if the TRUNCATE TABLE syntax is not supported, it falls back to a DELETE FROM TABLE query)

引数:
string$namename of the table that should be truncated
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。

vacuum ( table = null,
options = array() 
)

Optimize (vacuum) all the tables in the db (or only the specified table) and optionally run ANALYZE.

引数:
string$tabletable name (all the tables if empty)
array$optionsan array with driver-specific options:
  • timeout [int] (in seconds) [mssql-only]
  • analyze [boolean] [pgsql and mysql]
  • full [boolean] [pgsql-only]
  • freeze [boolean] [pgsql-only]
戻り値:
mixed MDB2_OK success, a MDB2 error on failure public

MDB2_Driver_Manager_Commonを再定義しています。


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