/**
  * Gather expansion tables.
  *
  * @return array The tables.
  */
 public function getExpansionTables()
 {
     return nl_getRecordExpansions();
 }
Beispiel #2
0
 /**
  * Delete all records that belong to the exhibit.
  */
 public function deleteChildRecords()
 {
     // Get records table and name.
     $recordsTable = $this->getTable('NeatlineRecord');
     $rName = $recordsTable->getTableName();
     // Gather record expansion tables.
     foreach (nl_getRecordExpansions() as $expansion) {
         $eName = $expansion->getTableName();
         // Delete expansion rows on child records.
         $this->_db->query("DELETE {$eName} FROM {$eName}\n                INNER JOIN {$rName} ON {$eName}.parent_id = {$rName}.id\n                WHERE {$rName}.exhibit_id = {$this->id}\n            ");
     }
     // Delete child records.
     $recordsTable->delete($rName, array('exhibit_id=?' => $this->id));
 }