PHP 클래스 Horde_Db_Adapter_Sqlite_Schema, horde

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

공개 메소드들

메소드 설명
addColumn ( string $tableName, string $columnName, string $type, array $options = [] ) Adds a new column to a table.
addPrimaryKey ( string $tableName, $columns ) Adds a primary key to a table.
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.
indexes ( string $tableName, string $name = null ) : array Returns a list of tables indexes.
makeColumn ( string $name, string $default, string $sqlType = null, boolean $null = true ) : Horde_Db_Adapter_Base_Column Factory for Column objects.
modifyDate ( string $reference, string $operator, integer $amount, string $interval ) : string Generates a modified date for SELECT queries.
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.
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.
tables ( ) : array Returns a list of all tables of the current database.

보호된 메소드들

메소드 설명
_alterTable ( string $tableName, array $options = [], function $callback = null ) Alters a table.
_copyTable ( string $from, string $to, array $options = [], function $callback = null ) Copies a table.
_copyTableContents ( string $from, string $to, array $columns, array $rename = [] ) Copies the content of one table to another.
_copyTableIndexes ( string $from, string $to, array $rename = [] ) Copies indexes from one table to another.
_defaultPrimaryKeyType ( ) : string Returns a column type definition to be use for primary keys.
_moveTable ( string $from, string $to, array $options = [], function $callback = null ) Moves a table.

메소드 상세

_alterTable() 보호된 메소드

This is done by creating a temporary copy, applying changes and callback methods, and copying the table back.
protected _alterTable ( string $tableName, array $options = [], function $callback = null )
$tableName string A table name.
$options array Any options to apply when creating the temporary table. Supports a 'rename' key for the new table name, additionally to the options in createTable().
$callback function A callback function that can manipulate the Horde_Db_Adapter_Base_TableDefinition object available in $definition. See _copyTable().

_copyTable() 보호된 메소드

Also applies changes and callback methods before creating the new table.
protected _copyTable ( string $from, string $to, array $options = [], function $callback = null )
$from string The name of the source table.
$to string The name of the target table.
$options array Any options to apply when creating the temporary table. Supports a 'rename' key for the new table name, additionally to the options in createTable().
$callback function A callback function that can manipulate the Horde_Db_Adapter_Base_TableDefinition object available in $definition.

_copyTableContents() 보호된 메소드

Copies the content of one table to another.
protected _copyTableContents ( string $from, string $to, array $columns, array $rename = [] )
$from string The name of the source table.
$to string The name of the target table.
$columns array A list of columns to copy.
$rename array A hash of columns to rename during the copy, with original names as keys and the new names as values.

_copyTableIndexes() 보호된 메소드

Copies indexes from one table to another.
protected _copyTableIndexes ( string $from, string $to, array $rename = [] )
$from string The name of the source table.
$to string The name of the target table.
$rename array A hash of columns to rename during the copy, with original names as keys and the new names as values.

_defaultPrimaryKeyType() 보호된 메소드

Returns a column type definition to be use for primary keys.
protected _defaultPrimaryKeyType ( ) : string
리턴 string Primary key type definition.

_moveTable() 보호된 메소드

This is done by creating a temporary copy, applying changes and callback methods, and dropping the original table.
protected _moveTable ( string $from, string $to, array $options = [], function $callback = null )
$from string The name of the source table.
$to string The name of the target table.
$options array Any options to apply when creating the temporary table. Supports a 'rename' key for the new table name, additionally to the options in createTable().
$callback function A callback function that can manipulate the Horde_Db_Adapter_Base_TableDefinition object available in $definition. See _copyTable().

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.

addPrimaryKey() 공개 메소드

Adds a primary key to a table.
public addPrimaryKey ( string $tableName, $columns )
$tableName string A table name.

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.

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 ) : Horde_Db_Adapter_Base_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_Base_Column A column object.

modifyDate() 공개 메소드

Generates a modified date for SELECT queries.
public modifyDate ( string $reference, string $operator, integer $amount, string $interval ) : string
$reference string The reference date - this is a column referenced in the SELECT.
$operator string Add or subtract time? (+/-)
$amount integer The shift amount (number of days if $interval is DAY, etc).
$interval string The interval (SECOND, MINUTE, HOUR, DAY, MONTH, YEAR).
리턴 string The generated INTERVAL clause.

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.

removeColumn() 공개 메소드

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

removeIndex() 공개 메소드

See parent class for examples.
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.

tables() 공개 메소드

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