Methods summary
public
Horde_Db_Adapter_Base_Column
|
#
makeColumn( string $name, string $default, string $sqlType = null, boolean $null = true )
Factory for Column objects.
Factory for Column objects.
Parameters
- $name
- <p>The column's name, such as "supplier_id" in
"supplier_id int(11)".</p>
- $default
- <p>The type-casted default value, such as "new" in
"sales_stage varchar(20) default 'new'".</p>
- $sqlType
- <p>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".</p>
- $null
- Whether this column allows NULL values.
Returns
Overrides
|
public
string
|
#
quoteColumnName( string $name )
Returns a quoted form of the column name.
Returns a quoted form of the column name.
Parameters
Returns
string The quoted column name.
|
public
string
|
#
quoteTrue( )
Returns a quoted boolean true.
Returns a quoted boolean true.
Returns
string The quoted boolean true.
Overrides
|
public
string
|
#
quoteFalse( )
Returns a quoted boolean false.
Returns a quoted boolean false.
Returns
string The quoted boolean false.
Overrides
|
public
string
|
#
quoteBinary( mixed $value )
Returns a quoted binary value.
Returns a quoted binary value.
Parameters
Returns
string The quoted binary value.
Overrides
|
public
array
|
#
nativeDatabaseTypes( )
Returns a hash of mappings from the abstract data types to the native
database types.
Returns a hash of mappings from the abstract data types to the native
database types.
See TableDefinition::column() for details on the recognized abstract
data types.
Returns
array A database type map.
See
TableDefinition::column()
Overrides
|
public
array
|
#
tables( )
Returns a list of all tables of the current database.
Returns a list of all tables of the current database.
Returns
array A table list.
|
public
Horde_Db_Adapter_Base_Index
|
#
primaryKey( string $tableName, string $name = null )
Returns a table's primary key.
Returns a table's primary key.
Parameters
- $tableName
- A table name.
- $name
- (can be removed?)
Returns
|
public
array
|
#
indexes( string $tableName, string $name = null )
Returns a list of tables indexes.
Returns a list of tables indexes.
Parameters
- $tableName
- A table name.
- $name
- (can be removed?)
Returns
array A list of Horde_Db_Adapter_Base_Index objects.
|
public
array
|
#
columns( string $tableName, string $name = null )
Returns a list of table columns.
Returns a list of table columns.
Parameters
- $tableName
- A table name.
- $name
- (can be removed?)
Returns
array A list of Horde_Db_Adapter_Base_Column objects.
|
public
|
#
renameTable( string $name, string $newName )
Renames a table.
Parameters
- $name
- A table name.
- $newName
- The new table name.
|
public
|
#
addColumn( string $tableName, string $columnName, string $type, array $options = array() )
Adds a new column to a table.
Adds a new column to a table.
Parameters
- $tableName
- A table name.
- $columnName
- A column name.
- $type
- A data type.
- $options
- <p>Column options. See
Horde_Db_Adapter_Base_TableDefinition#column()
for details.</p>
Overrides
|
public
|
#
removeColumn( string $tableName, string $columnName )
Removes a column from a table.
Removes a column from a table.
Parameters
- $tableName
- A table name.
- $columnName
- A column name.
Overrides
|
public
|
#
changeColumn( string $tableName, string $columnName, string $type, array $options = array() )
Changes an existing column's definition.
Changes an existing column's definition.
Parameters
- $tableName
- A table name.
- $columnName
- A column name.
- $type
- A data type.
- $options
- <p>Column options. See
Horde_Db_Adapter_Base_TableDefinition#column()
for details.</p>
|
public
|
#
changeColumnDefault( string $tableName, string $columnName, mixed $default )
Sets a new default value for a column.
Sets a new default value for a column.
If you want to set the default value to NULL, you are out of luck. You
need to execute the apppropriate SQL statement yourself.
Parameters
- $tableName
- A table name.
- $columnName
- A column name.
- $default
- The new default value.
|
public
|
#
renameColumn( string $tableName, string $columnName, string $newColumnName )
Renames a column.
Parameters
- $tableName
- A table name.
- $columnName
- A column name.
- $newColumnName
- The new column name.
|
public
|
#
addPrimaryKey( string $tableName, string|array $columns )
Adds a primary key to a table.
Adds a primary key to a table.
Parameters
- $tableName
- A table name.
- $columns
- $columnName One or more column names.
Throws
Since
Horde_Db 1.1.0
Overrides
|
public
|
#
removePrimaryKey( string $tableName )
Removes a primary key from a table.
Removes a primary key from a table.
Parameters
Throws
Since
Horde_Db 1.1.0
|
public
|
#
removeIndex( string $tableName, string|array $options = array() )
Removes an index from a table.
Removes an index from a table.
See parent class for examples.
Parameters
- $tableName
- A table name.
- $options
- <p>Either a column name or index options:
- name: (string) the index name.
- column: (string|array) column name(s).</p>
Overrides
|
public
|
#
createDatabase( string $name, array $options = array() )
Creates a database.
Parameters
- $name
- A database name.
- $options
- Database options.
|
public
|
|
public
string
|
#
currentDatabase( )
Returns the name of the currently selected database.
Returns the name of the currently selected database.
Returns
string The database name.
|
public
string
|
#
modifyDate( string $reference, string $operator, integer $amount, string $interval )
Generates a modified date for SELECT queries.
Generates a modified date for SELECT queries.
Parameters
- $reference
- <p>The reference date - this is a column
referenced in the SELECT.</p>
- $operator
- Add or subtract time? (+/-)
- $amount
- <p>The shift amount (number of days if $interval
is DAY, etc).</p>
- $interval
- <p>The interval (SECOND, MINUTE, HOUR, DAY,
MONTH, YEAR).</p>
Returns
string The generated INTERVAL clause.
Since
Horde_Db 1.2.0
Overrides
|