Propel 2 API
Class

Propel\Generator\Model\Diff\TableComparator

class TableComparator

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)

Sets the table the comparator starts from.

Table getFromTable()

Returns the table the comparator starts from.

setToTable(Table $toTable)

Sets the table the comparator goes to.

Table getToTable()

Returns the table the comparator goes to.

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

Returns the computed difference between two table objects.

integer compareColumns(boolean $caseInsensitive = false)

Returns the number of differences.

integer comparePrimaryKeys(boolean $caseInsensitive = false)

Returns the number of differences.

integer compareIndices(boolean $caseInsensitive = false)

Returns the number of differences.

integer compareForeignKeys(boolean $caseInsensitive = false)

Returns the number of differences.

Details

at line 24
public __construct($tableDiff = null)

Parameters

$tableDiff

at line 29
public getTableDiff()

at line 39
public setFromTable(Table $fromTable)

Sets the table the comparator starts from.

Parameters

Table $fromTable

at line 49
public Table getFromTable()

Returns the table the comparator starts from.

Return Value

Table

at line 59
public setToTable(Table $toTable)

Sets the table the comparator goes to.

Parameters

Table $toTable

at line 69
public Table getToTable()

Returns the table the comparator goes to.

Return Value

Table

at line 82
static public TableDiff|Boolean computeDiff(Table $fromTable, Table $toTable, boolean $caseInsensitive = false)

Returns the computed difference between two table objects.

Parameters

Table $fromTable
Table $toTable
boolean $caseInsensitive

Return Value

TableDiff|Boolean

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

Returns the number of differences.

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

Parameters

boolean $caseInsensitive

Return Value

integer

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

Returns the number of differences.

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

Parameters

boolean $caseInsensitive

Return Value

integer

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

Returns the number of differences.

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

Parameters

boolean $caseInsensitive

Return Value

integer

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

Returns the number of differences.

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

Parameters

boolean $caseInsensitive

Return Value

integer