DatabaseSchema: ezcDbSchemaDiff
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcDbSchemaDiff
|
ezcDbSchemaDiff is the main class for schema differences operations. [
source]
Member Variables
Method Summary
|
public ezcDbSchemaDiff |
__construct(
[$newTables = array()], [$changedTables = array()], [$removedTables = array()] )
Constructs an ezcDbSchemaDiff object. |
|
public void |
applyToDb(
$db )
Upgrades the database $db with the differences. |
|
public array(string) |
convertToDDL(
$db )
Returns the $db specific SQL queries that would update the database $db |
|
public static void |
createFromFile(
$format, $file )
Factory method to create a ezcDbSchemaDiff object from the file $file with the format $format. |
|
public void |
writeToFile(
$format, $file )
Writes the schema differences to the file $file in format $format. |
|
public static void |
__set_state(
$array )
|
Methods
__construct
ezcDbSchemaDiff __construct(
[array(string=>ezcDbSchemaTable)
$newTables = array()], [array(string=>ezcDbSchemaTableDiff)
$changedTables = array()], [array(string=>bool)
$removedTables = array()] )
Constructs an ezcDbSchemaDiff object.
Parameters
| Name |
Type |
Description |
$newTables |
array(string=>ezcDbSchemaTable) |
|
$changedTables |
array(string=>ezcDbSchemaTableDiff) |
|
$removedTables |
array(string=>bool) |
|
applyToDb
void applyToDb(
$db )
Upgrades the database $db with the differences.
Parameters
Throws
| Class | Description |
ezcDbSchemaInvalidWriterClassException |
if the handler associated with the $format is not a database schema writer. |
convertToDDL
Returns the $db specific SQL queries that would update the database $db
The database type can be given as both a database handler (instanceof ezcDbHandler) or the name of the database as string as retrieved through calling getName() on the database handler object.
Parameters
Throws
| Class | Description |
ezcDbSchemaInvalidWriterClassException |
if the handler associated with the $format is not a database schema writer. |
See also:
ezcDbHandler::getName().
createFromFile
void createFromFile(
string
$format, string
$file )
Factory method to create a ezcDbSchemaDiff object from the file $file with the format $format.
Parameters
| Name |
Type |
Description |
$format |
string |
|
$file |
string |
|
Throws
| Class | Description |
ezcDbSchemaInvalidReaderClassException |
if the handler associated with the $format is not a file schema reader. |
writeToFile
void writeToFile(
string
$format, string
$file )
Writes the schema differences to the file $file in format $format.
Parameters
| Name |
Type |
Description |
$format |
string |
|
$file |
string |
|
Throws
| Class | Description |
ezcDbSchemaInvalidWriterClassException |
if the handler associated with the $format is not a file schema writer. |
__set_state
void __set_state(
$array )
Parameters
| Name |
Type |
Description |
$array |
array |
|
Last updated: Thu, 31 Jan 2008