Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Static Public Member Functions | List of all members
eZDbSchemaChecker Class Reference
Database schema abstraction layer

Checks differences between schemas. More...

## Static Public Member Functions
static | diff ( $schema1, $schema2=array(), $schema1Type=false, $schema2Type=false)
static | diffTable ( $table1, $table2, $schema1Type, $schema2Type)
static | diffField ( $field1, $field2, $schema1Type, $schema2Type)
static | diffIndex ( $index1, $index2, $schema1Type, $schema2Type)

## Detailed Description

Checks differences between schemas.

Definition at line 18 of file ezdbschemachecker.php.

## Member Function Documentation

## ◆ diff()

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 34 of file ezdbschemachecker.php.

References diffTable().

## ◆ diffField()

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 181 of file ezdbschemachecker.php.

Referenced by diffTable().

## ◆ diffIndex()

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 228 of file ezdbschemachecker.php.

Referenced by diffTable().

## ◆ 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 96 of file ezdbschemachecker.php.

References diffField(), and diffIndex().

Referenced by diff().

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

- ezdbschemachecker.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.