Propel 2 API
Class

Propel\Generator\Model\Diff\DatabaseComparator

class DatabaseComparator

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

Methods

__construct($databaseDiff = null)

getDatabaseDiff()

setFromDatabase(Database $fromDatabase)

Sets the fromDatabase property.

Database getFromDatabase()

Returns the fromDatabase property.

setToDatabase(Database $toDatabase)

Sets the toDatabase property.

Database getToDatabase()

Returns the toDatabase property.

static DatabaseDiff|Boolean computeDiff(Database $fromDatabase, Database $toDatabase, boolean $caseInsensitive = false)

Returns the computed difference between two database objects.

integer compareTables(boolean $caseInsensitive = false)

Returns the number of differences.

Details

at line 26
public __construct($databaseDiff = null)

Parameters

$databaseDiff

at line 31
public getDatabaseDiff()

at line 41
public setFromDatabase(Database $fromDatabase)

Sets the fromDatabase property.

Parameters

Database $fromDatabase

at line 51
public Database getFromDatabase()

Returns the fromDatabase property.

Return Value

Database

at line 61
public setToDatabase(Database $toDatabase)

Sets the toDatabase property.

Parameters

Database $toDatabase

at line 71
public Database getToDatabase()

Returns the toDatabase property.

Return Value

Database

at line 84
static public DatabaseDiff|Boolean computeDiff(Database $fromDatabase, Database $toDatabase, boolean $caseInsensitive = false)

Returns the computed difference between two database objects.

Parameters

Database $fromDatabase
Database $toDatabase
boolean $caseInsensitive

Return Value

DatabaseDiff|Boolean

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

Returns the number of differences.

Compares the tables of the fromDatabase and the toDatabase, and modifies
the inner databaseDiff if necessary.

Parameters

boolean $caseInsensitive

Return Value

integer