Xataface 2.0
Xataface Application Framework
Public Member Functions | Data Fields
DB_Sync Class Reference

Public Member Functions

 DB_Sync ($db1, $db2, $table1=null, $table2=null, $renamed=null)
 equals ($table1=null, $table2=null)
 init ($table1, $table2, $renamed=null)
 checkTableNames ()
 loadTableData ()
 fieldArrayToSQLDef ($field)
 syncField ($fieldname, $after=null, $renameMap=null)
 syncTables ($table1=null, $table2=null, $renamedMap=null)

Data Fields

 $db1
 $db2
 $table1
 $table2
 $table1Data
 $table2Data
 $renamed = array()
 $listeners = array()

Detailed Description

Definition at line 4 of file Sync.php.


Member Function Documentation

checkTableNames ( )

Definition at line 57 of file Sync.php.

DB_Sync ( db1,
db2,
table1 = null,
table2 = null,
renamed = null 
)

Definition at line 18 of file Sync.php.

equals ( table1 = null,
table2 = null 
)

Compares 2 tables to see if they are identical in definition.

Parameters:
string$table1The name of the first table.
string$table2The name of the second table.
Returns:
boolean True if the tables have identical schemas.

Definition at line 34 of file Sync.php.

fieldArrayToSQLDef ( field)

Converts a field's array data into an SQL string definition.

Parameters:
array$fieldThe array data for a field.
Returns:
string SQL definition for field.

Definition at line 116 of file Sync.php.

init ( table1,
table2,
renamed = null 
)

Definition at line 44 of file Sync.php.

loadTableData ( )

Loads the table data for table 1 and table 2 into table1Data and table2Data respectively.

Definition at line 82 of file Sync.php.

syncField ( fieldname,
after = null,
renameMap = null 
)

Synchronizes the field named $fieldname.

Definition at line 165 of file Sync.php.

syncTables ( table1 = null,
table2 = null,
renamedMap = null 
)

Definition at line 216 of file Sync.php.


Field Documentation

$db1

Definition at line 6 of file Sync.php.

$db2

Definition at line 7 of file Sync.php.

$listeners = array()

Definition at line 16 of file Sync.php.

$renamed = array()

Definition at line 15 of file Sync.php.

$table1

Definition at line 9 of file Sync.php.

$table1Data

Definition at line 12 of file Sync.php.

$table2

Definition at line 10 of file Sync.php.

$table2Data

Definition at line 13 of file Sync.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations