PHP 클래스 Horde_Db_Adapter_Oracle_Schema, horde

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

공개 메소드들

메소드 설명
addColumn ( string $tableName, string $columnName, string $type, array $options = [] ) Adds a new column to a table.
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.
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.
createAutoincrementTrigger ( string $tableName, string $columnName ) Creates sequences and triggers for an autoincrementKey column.
createDatabase ( string $name, array $options = [] ) Creates a database.
currentDatabase ( ) : string Returns the name of the currently selected database.
dropDatabase ( string $name ) Drops a database.
dropTable ( string $name ) Drops a table from the database.
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.
makeColumn ( string $name, string $default, string $sqlType = null, boolean $null = true, integer $length = null, integer $precision = null, integer $scale = null ) : Horde_Db_Adapter_Base_Column Factory for Column objects.
makeTableDefinition ( $name, $base, $options = [] ) : Horde_Db_Adapter_Base_TableDefinition Factory for TableDefinition 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.
quoteBinary ( $value ) : string Returns a quoted binary value.
quoteColumnName ( string $name ) : string Returns a quoted form of the column name.
removeAutoincrementTrigger ( string $tableName, string $columnName = null ) Drops sequences and triggers for an autoincrementKey column.
removeColumn ( string $tableName, string $columnName ) Removes a column from a table.
removeIndex ( string $tableName, string | array $options = [] ) Removes an index from a table.
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.
tableAliasFor ( string $tableName ) : string Converts a table name into a suitable table alias.
tableAliasLength ( ) : integer Returns the maximum length a table alias can have.
tables ( ) : array Returns a list of all tables of the current database.

보호된 메소드들

메소드 설명
_clearTableCache ( string $tableName ) Clears the cache for tables when altering them.
_truncate ( string $name, integer $length = 30 ) : string Truncates an indentifier to a certain length.

메소드 상세

_clearTableCache() 보호된 메소드

Clears the cache for tables when altering them.
protected _clearTableCache ( string $tableName )
$tableName string A table name.

_truncate() 보호된 메소드

To avoid collisions, the identifier is split up by underscores and the parts truncated to 3 characters first.
protected _truncate ( string $name, integer $length = 30 ) : string
$name string An identifier.
$length integer The maximum length.
리턴 string The truncated identifier.

addColumn() 공개 메소드

Adds a new column to a table.
public addColumn ( 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.

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: - column: (Horde_Db_Adapter_Base_ColumnDefinition The column definition class. - null: (boolean) Whether to allow NULL values. - default: (mixed) Default column value. - autoincrement: (boolean) Whether the column is an autoincrement column. Driver depedendent.
리턴 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.

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.

createAutoincrementTrigger() 공개 메소드

Creates sequences and triggers for an autoincrementKey column.
public createAutoincrementTrigger ( string $tableName, string $columnName )
$tableName string A table name.
$columnName string A column name.

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.

dropTable() 공개 메소드

Drops a table from the database.
public dropTable ( string $name )
$name string A table name.

indexName() 공개 메소드

Cuts the index name to the maximum length of 30 characters limited by Oracle.
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.

makeColumn() 공개 메소드

Factory for Column objects.
public makeColumn ( string $name, string $default, string $sqlType = null, boolean $null = true, integer $length = null, integer $precision = null, integer $scale = null ) : Horde_Db_Adapter_Base_Column
$name string Column name, such as "supplier_id" in "supplier_id int(11)".
$default string Type-casted default value, such as "new" in "sales_stage varchar(20) default 'new'".
$sqlType string Column type.
$null boolean Whether this column allows NULL values.
$length integer Column width.
$precision integer Precision for NUMBER and FLOAT columns.
$scale integer Number of digits to the right of the decimal point in a number.
리턴 Horde_Db_Adapter_Base_Column A column object.

makeTableDefinition() 공개 메소드

Factory for TableDefinition objects.
public makeTableDefinition ( $name, $base, $options = [] ) : Horde_Db_Adapter_Base_TableDefinition
리턴 Horde_Db_Adapter_Base_TableDefinition A table definition 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.

quoteBinary() 공개 메소드

Returns a quoted binary value.
public quoteBinary ( $value ) : string
리턴 string The quoted binary value.

quoteColumnName() 공개 메소드

With Oracle, if using quoted identifiers, you need to use them everywhere. 'SELECT * FROM "tablename"' is NOT the same as 'SELECT * FROM tablename'. Thus we cannot blindly quote table or column names, unless we know that in subsequent queries they will be used too.
public quoteColumnName ( string $name ) : string
$name string A column name.
리턴 string The quoted column name.

removeAutoincrementTrigger() 공개 메소드

If $columnName is specified, the sequences and triggers are only dropped if $columnName is actually an autoincrementKey column.
public removeAutoincrementTrigger ( string $tableName, string $columnName = null )
$tableName string A table name.
$columnName string A column name.

removeColumn() 공개 메소드

Removes a column from a table.
public removeColumn ( string $tableName, string $columnName )
$tableName string A table name.
$columnName string A column name.

removeIndex() 공개 메소드

Removes an index from a table.
public removeIndex ( string $tableName, string | array $options = [] )
$tableName string A table name.
$options string | array Either a column name or index options: - name: (string) the index name. - column: (string|array) column name(s).

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.

tableAliasFor() 공개 메소드

Converts a table name into a suitable table alias.
public tableAliasFor ( string $tableName ) : string
$tableName string A table name.
리턴 string A possible alias name for the table.

tableAliasLength() 공개 메소드

Returns the maximum length a table alias can have.
public tableAliasLength ( ) : integer
리턴 integer The maximum table alias length.

tables() 공개 메소드

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