Source for file externalDataServerConnection.php
Documentation is available at externalDataServerConnection.php
* <b>Class Description</b>: The overarching class in the Distributed Data Management Client package
* (see {@link package.php} for documentation
* of the DDMS package.). This is the only class in the system that is directly used by the business application that uses the DDMS.
* During its construction the DDMS client's configuration settings are loaded into the class variables. The configuration settings
* are stored the DDMSs database tables (???) and its config file (??????.ini).
* @author Jan van der Breggen
$x = new db('rigregversiontwo');
$x->query ('select table_name, primary_key, remote_key, local_refresh from linked_tables order by table_name desc');
foreach ($x->rows_array() AS $row) {
$table = $row['table_name'];
$sql = "select `column`, referenced_table, referenced_column, lt.remote_key as 'remote_referenced_column',cascading_update, cascading_insert, cascading_delete from `references`, linked_tables lt where referenced_table = lt.table_name and `table` = '$table'";
$y = new db('rigregversiontwo');
$references = $y->rows_array();
$this->localDataObjects[$row['table_name']]= new ExternallyLinkedOrm($row, $references, $this);
//$table->refreshLocalData('allRecords');
$table->refreshLocalData();
return $endTime['sec'] - $startTime['sec'];
* sorts the localDataObjects array to reflect referential integrity.
* When data is loaded into linked tables, either at system setup time, or during
* refresh data event, records with references to local key values of other tables
* should be loaded after the records they refer to was loaded and local key values
* what will be the foreign keys were generated
* post: the localDataObjects array will be sorted in such a way that for each table Y
* with references to local_key values in table X, table X will be located at a lower
* array index than table Y. Tables that are 'select only' will be put at the beginning
* of the array (even if these tables have references to linked tables with local_key
* values, they will always have the remote_key value as their foreign key)
foreach ($dataObjects as $object)
if ($object->hasReferences()){
foreach ($results as $result){
$temp[$result->getTableName()]= $result ;
$temp[$object->getTableName()]= $object;
* Description: returns a subset of the localDataObjects array
* @param array of type string $objectNames, table_name values
* @return array of type ExternallyLinkedOrm
foreach ($objectNames as $name)
if ($object->hasForeignKeyReferenceTo($referredTableName))
|