/**
  * Delete from the database on exit
  */
 function __destruct()
 {
     if ($this->my_uuid) {
         $conn = AIR2_DBManager::get_master_connection();
         $conn->exec('delete from tag where tag_tm_id in (select tm_id from ' . 'tag_master where tm_name = ?)', array($this->my_uuid));
     }
     trec_destruct($this);
 }
 /**
  * Delete from the database on exit
  */
 function __destruct()
 {
     if ($this->my_uuid) {
         // make sure any src_export records are cleaned up
         $conn = AIR2_DBManager::get_master_connection();
         $bid = 'select bin_id from bin where bin_uuid = ?';
         $del = "delete from src_export where se_xid = ({$bid}) and se_ref_type = ?";
         $conn->exec($del, array($this->my_uuid, SrcExport::$REF_TYPE_BIN));
     }
     trec_destruct($this);
 }
/**
 * Cleanup existing database objects from some crazy, aborted run.
 *
 * @param Doctrine_Record $proto
 * @param array   $uuids
 */
function trec_remove_stale($proto, $uuids)
{
    $name = get_class($proto);
    $glob = 'TREC_' . strtoupper($name) . '_IS_CLEAN';
    if (!defined($glob)) {
        foreach ($uuids as $id) {
            trec_destruct($proto, $id);
        }
        define($glob, 1);
    }
}
 /**
  * Delete from the database on exit
  */
 function __destruct()
 {
     trec_destruct($this);
 }