Propel API
Class

PropelTableComparator

class PropelTableComparator

Service class for comparing Table objects Heavily inspired by Doctrine2's Migrations (see http://github.com/doctrine/dbal/tree/master/lib/Doctrine/DBAL/Schema/)

Methods

__construct($tableDiff = null)

getTableDiff()

setFromTable(Table $fromTable)

Set the table the comparator starts from

Table getFromTable()

Get the table the comparator starts from

setToTable(Table $toTable)

Set the table the comparator goes to

Table getToTable()

Get the table the comparator goes to

static PropelTableDiff|boolean computeDiff(Table $fromTable, Table $toTable, boolean $caseInsensitive = false)

Compute and return the difference between two table objects

integer compareColumns(boolean $caseInsensitive = false)

Compare the columns of the fromTable and the toTable, and modifies the inner tableDiff if necessary.

integer comparePrimaryKeys(boolean $caseInsensitive = false)

Compare the primary keys of the fromTable and the toTable, and modifies the inner tableDiff if necessary.

integer compareIndices(boolean $caseInsensitive = false)

Compare the indices and unique indices of the fromTable and the toTable, and modifies the inner tableDiff if necessary.

integer compareForeignKeys(boolean $caseInsensitive = false)

Compare the foreign keys of the fromTable and the toTable, and modifies the inner tableDiff if necessary.

Details

at line 29
public __construct($tableDiff = null)

Parameters

$tableDiff

at line 34
public getTableDiff()

at line 44
public setFromTable(Table $fromTable)

Set the table the comparator starts from

Parameters

Table $fromTable

at line 54
public Table getFromTable()

Get the table the comparator starts from

Return Value

Table

at line 64
public setToTable(Table $toTable)

Set the table the comparator goes to

Parameters

Table $toTable

at line 74
public Table getToTable()

Get the table the comparator goes to

Return Value

Table

at line 89
static public PropelTableDiff|boolean computeDiff(Table $fromTable, Table $toTable, boolean $caseInsensitive = false)

Compute and return the difference between two table objects

Parameters

Table $fromTable
Table $toTable
boolean $caseInsensitive Whether the comparison is case insensitive. False by default.

Return Value

PropelTableDiff|boolean return false if the two tables are similar

at line 113
public integer compareColumns(boolean $caseInsensitive = false)

Compare the columns of the fromTable and the toTable, and modifies the inner tableDiff if necessary.

Returns the number of differences.

Parameters

boolean $caseInsensitive Whether the comparison is case insensitive. False by default.

Return Value

integer The number of column differences

at line 173
public integer comparePrimaryKeys(boolean $caseInsensitive = false)

Compare the primary keys of the fromTable and the toTable, and modifies the inner tableDiff if necessary.

Returns the number of differences.

Parameters

boolean $caseInsensitive Whether the comparison is case insensitive. False by default.

Return Value

integer The number of primary key differences

at line 223
public integer compareIndices(boolean $caseInsensitive = false)

Compare the indices and unique indices of the fromTable and the toTable, and modifies the inner tableDiff if necessary.

Returns the number of differences.

Parameters

boolean $caseInsensitive Whether the comparison is case insensitive. False by default.

Return Value

integer The number of index differences

at line 272
public integer compareForeignKeys(boolean $caseInsensitive = false)

Compare the foreign keys of the fromTable and the toTable, and modifies the inner tableDiff if necessary.

Returns the number of differences.

Parameters

boolean $caseInsensitive Whether the comparison is case insensitive. False by default.

Return Value

integer The number of foreign key differences