Doctrine


Doctrine\DBAL\Schema\Comparator
/Doctrine/DBAL/Schema/Comparator.php at line 35

Class Comparator

Comparator

public class Comparator

Compare to Schemas and return an instance of SchemaDiff

Copyright:
Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
License:
http://ez.no/licenses/new_bsd New BSD License
http://www.opensource.org/licenses/lgpl-license.php LGPL
See Also:
www.doctrine-project.org
Since:
2.0
Version:
$Revision$
Author:
Benjamin Eberlei

Method Summary
void

addColumnPlatformOptionCheck(string optionName)

SchemaDiff

compare(Schema fromSchema, Schema toSchema)

Returns a SchemaDiff object containing the differences between the schemas $fromSchema and $toSchema.

static SchemaDiff

compareSchemas(Schema fromSchema, Schema toSchema)

array

diffColumn(Column column1, Column column2)

Returns the difference between the fields $field1 and $field2.

bool

diffForeignKey(ForeignKeyConstraint key1, ForeignKeyConstraint key2)

bool

diffIndex(Index index1, Index index2)

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

void

diffSequence(Sequence sequence1, Sequence sequence2)

bool|TableDiff

diffTable(Table table1, Table table2)

Returns the difference between the tables $table1 and $table2.

Method Detail

/Doctrine/DBAL/Schema/Comparator.php at line 45

addColumnPlatformOptionCheck

public void addColumnPlatformOptionCheck(string optionName)


/Doctrine/DBAL/Schema/Comparator.php at line 73

compare

public SchemaDiff compare(Schema fromSchema, Schema toSchema)

Returns a SchemaDiff object containing the differences between the schemas $fromSchema and $toSchema.

The returned diferences are returned in such a way that they contain the operations to change the schema stored in $fromSchema to the schema that is stored in $toSchema.


/Doctrine/DBAL/Schema/Comparator.php at line 55

compareSchemas

public static SchemaDiff compareSchemas(Schema fromSchema, Schema toSchema)


/Doctrine/DBAL/Schema/Comparator.php at line 305

diffColumn

public array diffColumn(Column column1, Column column2)

Returns the difference between the fields $field1 and $field2.

If there are differences this method returns $field2, otherwise the boolean false.


/Doctrine/DBAL/Schema/Comparator.php at line 273

diffForeignKey

public bool diffForeignKey(ForeignKeyConstraint key1, ForeignKeyConstraint key2)


/Doctrine/DBAL/Schema/Comparator.php at line 366

diffIndex

public bool diffIndex(Index index1, Index index2)

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

Compares $index1 with $index2 and returns $index2 if there are any differences or false in case there are no differences.


/Doctrine/DBAL/Schema/Comparator.php at line 140

diffSequence

public void diffSequence(Sequence sequence1, Sequence sequence2)


/Doctrine/DBAL/Schema/Comparator.php at line 163

diffTable

public bool|TableDiff diffTable(Table table1, Table table2)

Returns the difference between the tables $table1 and $table2.

If there are no differences this method returns the boolean false.


Doctrine