PHP 클래스 Horde_Db_Adapter_Mysql_Schema, horde

저자: Mike Naberezny ([email protected])
저자: Derek DeVries ([email protected])
저자: Chuck Hagenbuch ([email protected])
저자: Jan Schneider ([email protected])
상속: extends Horde_Db_Adapter_Base_Schema
파일 보기 프로젝트 열기: horde/horde

공개 메소드들

메소드 설명
_mysqlCharsetName ( string $charset ) : string Returns the MySQL name of a character set.
addColumnOptions ( string $sql, array $options ) : string Adds default/null options to column SQL definitions.
buildClause ( string $lhs, string $op, string $rhs, boolean $bind = false, array $params = [] ) : string | array Returns an expression using the specified operator.
caseSensitiveEqualityOperator ( )
changeColumn ( string $tableName, string $columnName, string $type, array $options = [] ) Changes an existing column's definition.
changeColumnDefault ( string $tableName, string $columnName, mixed $default ) Sets a new default value for a column.
columns ( string $tableName, string $name = null ) : array Returns a list of table columns.
createDatabase ( string $name, array $options = [] ) Creates a database.
currentDatabase ( ) : string Returns the name of the currently selected database.
dropDatabase ( string $name ) Drops a database.
endTable ( string | Horde_Db_Adapter_Base_TableDefinition $name, array $options = [] ) Finishes and executes table creation.
getCharset ( ) : string Returns the character set of query results.
getCollation ( ) : string Returns the database collation strategy.
indexName ( string $tableName, string | array $options = [] ) Builds the name for an index.
indexes ( string $tableName, string $name = null ) : array Returns a list of tables indexes.
limitedUpdateConditions ( $whereSql, $quotedTableName, $quotedPrimaryKey )
makeColumn ( string $name, string $default, string $sqlType = null, boolean $null = true ) : Horde_Db_Adapter_Mysql_Column Factory for Column objects.
nativeDatabaseTypes ( ) : array Returns a hash of mappings from the abstract data types to the native database types.
primaryKey ( string $tableName, string $name = null ) : Horde_Db_Adapter_Base_Index Returns a table's primary key.
quoteColumnName ( string $name ) : string Returns a quoted form of the column name.
quoteTableName ( string $name ) : string Returns a quoted form of the table name.
removePrimaryKey ( string $tableName ) Removes a primary key from a table.
renameColumn ( string $tableName, string $columnName, string $newColumnName ) Renames a column.
renameTable ( string $name, string $newName ) Renames a table.
setCharset ( string $charset ) Sets the client and result charset.
showVariable ( string $name ) : string Returns a database variable.
tables ( ) : array Returns a list of all tables of the current database.
typeToSql ( string $type, integer $limit = null, integer $precision = null, integer $scale = null, boolean $unsigned = null ) : string Generates the SQL definition for a column type.

메소드 상세

_mysqlCharsetName() 공개 메소드

Returns the MySQL name of a character set.
public _mysqlCharsetName ( string $charset ) : string
$charset string A charset name.
리턴 string MySQL-normalized charset.

addColumnOptions() 공개 메소드

Adds default/null options to column SQL definitions.
public addColumnOptions ( string $sql, array $options ) : string
$sql string Existing SQL definition for a column.
$options array Column options: - null: (boolean) Whether to allow NULL values. - default: (mixed) Default column value. - autoincrement: (boolean) Whether the column is an autoincrement column. Driver depedendent. - after: (string) Insert column after this one. MySQL specific.
리턴 string The manipulated SQL definition.

buildClause() 공개 메소드

Returns an expression using the specified operator.
public buildClause ( string $lhs, string $op, string $rhs, boolean $bind = false, array $params = [] ) : string | array
$lhs string The column or expression to test.
$op string The operator.
$rhs string The comparison value.
$bind boolean If true, the method returns the query and a list of values suitable for binding as an array.
$params array Any additional parameters for the operator.
리턴 string | array The SQL test fragment, or an array containing the query and a list of values if $bind is true.

caseSensitiveEqualityOperator() 공개 메소드

changeColumn() 공개 메소드

Changes an existing column's definition.
public changeColumn ( string $tableName, string $columnName, string $type, array $options = [] )
$tableName string A table name.
$columnName string A column name.
$type string A data type.
$options array Column options. See Horde_Db_Adapter_Base_TableDefinition#column() for details.

changeColumnDefault() 공개 메소드

If you want to set the default value to NULL, you are out of luck. You need to execute the apppropriate SQL statement yourself.
public changeColumnDefault ( string $tableName, string $columnName, mixed $default )
$tableName string A table name.
$columnName string A column name.
$default mixed The new default value.

columns() 공개 메소드

Returns a list of table columns.
public columns ( string $tableName, string $name = null ) : array
$tableName string A table name.
$name string (can be removed?)
리턴 array A list of Horde_Db_Adapter_Base_Column objects.

createDatabase() 공개 메소드

Creates a database.
public createDatabase ( string $name, array $options = [] )
$name string A database name.
$options array Database options.

currentDatabase() 공개 메소드

Returns the name of the currently selected database.
public currentDatabase ( ) : string
리턴 string The database name.

dropDatabase() 공개 메소드

Drops a database.
public dropDatabase ( string $name )
$name string A database name.

endTable() 공개 메소드

Finishes and executes table creation.
public endTable ( string | Horde_Db_Adapter_Base_TableDefinition $name, array $options = [] )
$name string | Horde_Db_Adapter_Base_TableDefinition A table name or object.
$options array A list of options. See createTable().

getCharset() 공개 메소드

Returns the character set of query results.
public getCharset ( ) : string
리턴 string The result's charset.

getCollation() 공개 메소드

Returns the database collation strategy.
public getCollation ( ) : string
리턴 string Database collation.

indexName() 공개 메소드

Cuts the index name to the maximum length of 64 characters limited by MySQL.
public indexName ( string $tableName, string | array $options = [] )
$tableName string A table name.
$options string | array Either a column name or index options: - column: (string|array) column name(s). - name: (string) the index name to fall back to if no column names specified.

indexes() 공개 메소드

Returns a list of tables indexes.
public indexes ( string $tableName, string $name = null ) : array
$tableName string A table name.
$name string (can be removed?)
리턴 array A list of Horde_Db_Adapter_Base_Index objects.

limitedUpdateConditions() 공개 메소드

public limitedUpdateConditions ( $whereSql, $quotedTableName, $quotedPrimaryKey )

makeColumn() 공개 메소드

Factory for Column objects.
public makeColumn ( string $name, string $default, string $sqlType = null, boolean $null = true ) : Horde_Db_Adapter_Mysql_Column
$name string The column's name, such as "supplier_id" in "supplier_id int(11)".
$default string The type-casted default value, such as "new" in "sales_stage varchar(20) default 'new'".
$sqlType string Used to extract the column's type, length and signed status, if necessary. For example "varchar" and "60" in "company_name varchar(60)" or "unsigned => true" in "int(10) UNSIGNED".
$null boolean Whether this column allows NULL values.
리턴 Horde_Db_Adapter_Mysql_Column A column object.

nativeDatabaseTypes() 공개 메소드

See TableDefinition::column() for details on the recognized abstract data types.
또한 보기: TableDefinition::column()
public nativeDatabaseTypes ( ) : array
리턴 array A database type map.

primaryKey() 공개 메소드

Returns a table's primary key.
public primaryKey ( string $tableName, string $name = null ) : Horde_Db_Adapter_Base_Index
$tableName string A table name.
$name string (can be removed?)
리턴 Horde_Db_Adapter_Base_Index The primary key index object.

quoteColumnName() 공개 메소드

Returns a quoted form of the column name.
public quoteColumnName ( string $name ) : string
$name string A column name.
리턴 string The quoted column name.

quoteTableName() 공개 메소드

Defaults to column name quoting.
public quoteTableName ( string $name ) : string
$name string A table name.
리턴 string The quoted table name.

removePrimaryKey() 공개 메소드

Removes a primary key from a table.
public removePrimaryKey ( string $tableName )
$tableName string A table name.

renameColumn() 공개 메소드

Renames a column.
public renameColumn ( string $tableName, string $columnName, string $newColumnName )
$tableName string A table name.
$columnName string A column name.
$newColumnName string The new column name.

renameTable() 공개 메소드

Renames a table.
public renameTable ( string $name, string $newName )
$name string A table name.
$newName string The new table name.

setCharset() 공개 메소드

Sets the client and result charset.
public setCharset ( string $charset )
$charset string The character set to use for client queries and results.

showVariable() 공개 메소드

Convenience wrapper around "SHOW VARIABLES LIKE 'name'".
public showVariable ( string $name ) : string
$name string A variable name.
리턴 string The variable value.

tables() 공개 메소드

Returns a list of all tables of the current database.
public tables ( ) : array
리턴 array A table list.

typeToSql() 공개 메소드

Generates the SQL definition for a column type.
public typeToSql ( string $type, integer $limit = null, integer $precision = null, integer $scale = null, boolean $unsigned = null ) : string
$type string A column type.
$limit integer Maximum column length (non decimal type only)
$precision integer The number precision (decimal type only).
$scale integer The number scaling (decimal columns only).
$unsigned boolean Whether the column is an unsigned number (non decimal columns only).
리턴 string The SQL definition. If $type is not one of the internally supported types, $type is returned unchanged.