Path

ez components / documentation / api reference / 2007.1.1 / databaseschema


eZ Components 2007.1.1

DatabaseSchema: ezcDbSchemaDiff

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcDbSchemaDiff

ezcDbSchemaDiff is the main class for schema differences operations. [source]

Member Variables

public array(string=>array) $changedTables
All changed tables
public array(string=>ezcDbSchemaTable) $newTables
All added tables
public array(string=>bool) $removedTables
All removed tables

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

Name Type Description
$db ezcDbHandler  

Throws

ClassDescription
ezcDbSchemaInvalidWriterClassException if the handler associated with the $format is not a database schema writer.

convertToDDL

array(string) convertToDDL( $db )
Returns the $db specific SQL queries that would update the database $db

Parameters

Name Type Description
$db ezcDbHandler  

Throws

ClassDescription
ezcDbSchemaInvalidWriterClassException if the handler associated with the $format is not a database schema writer.

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

ClassDescription
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

ClassDescription
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: Wed, 28 Nov 2007