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

Public メソッド

 splitTableSchema ($table)
 getFieldDeclarationList ($fields)
 _fixSequenceName ($sqn, $check=false)
 _fixIndexName ($idx)
 createDatabase ($database, $options=array())
 alterDatabase ($database, $options=array())
 dropDatabase ($database)
 _getCreateTableQuery ($name, $fields, $options=array())
 _getTemporaryTableQuery ()
 createTable ($name, $fields, $options=array())
 dropTable ($name)
 truncateTable ($name)
 vacuum ($table=null, $options=array())
 alterTable ($name, $changes, $check)
 listDatabases ()
 listUsers ()
 listViews ($database=null)
 listTableViews ($table)
 listTableTriggers ($table=null)
 listFunctions ()
 listTables ($database=null)
 listTableFields ($table)
 createIndex ($table, $name, $definition)
 dropIndex ($table, $name)
 listTableIndexes ($table)
 _getAdvancedFKOptions ($definition)
 createConstraint ($table, $name, $definition)
 dropConstraint ($table, $name, $primary=false)
 listTableConstraints ($table)
 createSequence ($seq_name, $start=1)
 dropSequence ($name)
 listSequences ($database=null)

関数

_fixIndexName ( idx)

Removes any formatting in an index name using the 'idxname_format' option

引数:
string$idxstring that containts name of anl index
戻り値:
string name of the index with eventual formatting removed protected
_fixSequenceName ( sqn,
check = false 
)

Removes any formatting in an sequence name using the 'seqname_format' option

引数:
string$sqnstring that containts name of a potential sequence
bool$checkif only formatted sequences should be returned
戻り値:
string name of the sequence with possible formatting removed protected
_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_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

_getCreateTableQuery ( name,
fields,
options = array() 
)

Create a basic SQL query for a new table creation

引数:
string$nameName of the database that should be created
array$fieldsAssociative array that contains the definition of each field of the new table
array$optionsAn associative array of table options
戻り値:
mixed string (the SQL query) on success, a MDB2 error on failure
参照:
createTable()

A method to return the required SQL string that fits between CREATE ... TABLE to create the table as a temporary table.

Should be overridden in driver classes to return the correct string for the specific database type.

The default is to return the string "TEMPORARY" - this will result in a SQL error for any database that does not support temporary tables, or that requires a different SQL command from "CREATE TEMPORARY TABLE".

戻り値:
string The string required to be placed between "CREATE" and "TABLE" to generate a temporary table, if possible.
alterDatabase ( database,
options = array() 
)

alter an existing 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_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

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_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

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. The full structure of the array looks like this:
          array (
              [primary] => 0
              [unique]  => 0
              [foreign] => 1
              [check]   => 0
              [fields] => array (
                  [field1name] => array() // one entry per each field covered
                  [field2name] => array() // by the index
                  [field3name] => array(
                      [sorting]  => ascending
                      [position] => 3
                  )
              )
              [references] => array(
                  [table] => name
                  [fields] => array(
                      [field1name] => array(  //one entry per each referenced field
                           [position] => 1
                      )
                  )
              )
              [deferrable] => 0
              [initiallydeferred] => 0
              [onupdate] => CASCADE|RESTRICT|SET NULL|SET DEFAULT|NO ACTION
              [ondelete] => CASCADE|RESTRICT|SET NULL|SET DEFAULT|NO ACTION
              [match] => SIMPLE|PARTIAL|FULL
          );
          
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Manager_mysqlで再定義されています。

createDatabase ( database,
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_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

createIndex ( table,
name,
definition 
)

Get the stucture of a field into an array

引数:
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' ), 'last_login' => array() ) )

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

MDB2_Driver_Manager_mysqlで再定義されています。

createSequence ( seq_name,
start = 1 
)

create sequence

引数:
string$seq_namename of the sequence to be created
string$startstart value of the sequence; default is 1
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Manager_pgsqlで再定義されています。

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', 'temporary' => true|false, );
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public

MDB2_Driver_Manager_mysqlで再定義されています。

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_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

dropDatabase ( database)

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_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

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_mysqlで再定義されています。

dropSequence ( 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_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

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_mysqlで再定義されています。

getFieldDeclarationList ( fields)

Get declaration of a number of field in bulk

引数:
array$fieldsa multidimensional associative array. The first dimension determines the field name, while the second dimension is keyed with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

default Boolean value to be used as default for this field.

notnull Boolean flag that indicates whether this field is constrained to not be set to null.

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

list all databases

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

MDB2_Driver_Manager_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

list all functions in the current database

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

MDB2_Driver_Manager_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

listSequences ( database = null)

list all sequences in the current database

引数:
stringdatabase, the current is default NB: not all the drivers can get the sequence names from a database other than the current one
戻り値:
mixed array of sequence names on success, a MDB2 error on failure public

MDB2_Driver_Manager_mysqlで再定義されています。

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_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

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_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

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_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

listTables ( database = null)

list all tables in the current database

引数:
stringdatabase, the current is default. NB: not all the drivers can get the table names from a database other than the current one
戻り値:
mixed array of table names on success, a MDB2 error on failure public

MDB2_Driver_Manager_mysqlで再定義されています。

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_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

listTableViews ( table)

list the views in the database that reference a given table

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

MDB2_Driver_Manager_pgsqlで再定義されています。

listUsers ( )

list all users

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

MDB2_Driver_Manager_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

listViews ( database = null)

list all views in the current database

引数:
stringdatabase, the current is default NB: not all the drivers can get the view names from a database other than the current one
戻り値:
mixed array of view names on success, a MDB2 error on failure public

MDB2_Driver_Manager_mysqlで再定義されています。

splitTableSchema ( table)

Split the "[owner|schema].table" notation into an array

引数:
string$table[schema and] table name
戻り値:
array array(schema, table) private
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_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。

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_mysql, と MDB2_Driver_Manager_pgsqlで再定義されています。


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