eZ Publish  [4.2]
eZDbSchemaChecker Class Reference

Checks differences between schemas. More...

List of all members.

Static Public Member Functions

static diff ($schema1, $schema2=array(), $schema1Type=false, $schema2Type=false)
static diffField ($field1, $field2, $schema1Type, $schema2Type)
static diffIndex ($index1, $index2, $schema1Type, $schema2Type)
static diffTable ($table1, $table2, $schema1Type, $schema2Type)

Detailed Description

Checks differences between schemas.

Definition at line 36 of file ezdbschemachecker.php.


Member Function Documentation

static eZDbSchemaChecker::diff ( schema1,
schema2 = array(),
schema1Type = false,
schema2Type = false 
) [static]

Finds the difference between the scemas $schema1 and $schema2.

Returns:
An array containing:
  • new_tables - A list of new tables that have been added
  • removed_tables - A list of tables that have been removed
  • table_changes - Changes in table definition
    • added_fields - A list of new fields in the table
    • removed_fields - A list of removed fields in the table
    • changed_fields - A list of fields that have changed definition
    • added_indexes - A list of new indexes in the table
    • removed_indexes - A list of removed indexes in the table
    • changed_indexes - A list of indexes that have changed definition

Definition at line 52 of file ezdbschemachecker.php.

static eZDbSchemaChecker::diffField ( field1,
field2,
schema1Type,
schema2Type 
) [static]

Finds the difference between the field $field1 and $field2.

Returns:
The field definition of the changed field or false if there are no changes.

Definition at line 199 of file ezdbschemachecker.php.

Referenced by diffTable().

static eZDbSchemaChecker::diffIndex ( index1,
index2,
schema1Type,
schema2Type 
) [static]

Finds the difference between the indexes $index1 and $index2.

Returns:
The index definition of the changed index or false if there are no changes.

Definition at line 242 of file ezdbschemachecker.php.

Referenced by diffTable().

static eZDbSchemaChecker::diffTable ( table1,
table2,
schema1Type,
schema2Type 
) [static]

Finds the difference between the tables $table1 and $table2 by looking at the fields and indexes.

Returns:
An array containing:
  • added_fields - A list of new fields in the table
  • removed_fields - A list of removed fields in the table
  • changed_fields - A list of fields that have changed definition
  • added_indexes - A list of new indexes in the table
  • removed_indexes - A list of removed indexes in the table
  • changed_indexes - A list of indexes that have changed definition

Definition at line 114 of file ezdbschemachecker.php.

Referenced by diff().


The documentation for this class was generated from the following file: