mDb->StartTrans(); $this->mContentId = 0; $pDataHash['content_id'] = 0; if ( LibertyContent::store( $pDataHash ) ) { $pDataHash['contact_store']['content_id'] = $pDataHash['content_id']; $result = $this->mDb->associateInsert( $table, $pDataHash['contact_store'] ); $this->mDb->CompleteTrans(); } else { $this->mDb->RollbackTrans(); $this->mErrors['store'] = 'Failed to store this contact.'; } $Xref = new ContactXref(); $pParams = [ 'source' => '#S', 'content_id' => $pDataHash['content_id'], 'xkey' => $data[2], 'xorder' => '0', 'xkey_ext' => $data[1], ]; $Xref->store($pParams); $pParams = [ 'source' => '#P', 'content_id' => $pDataHash['content_id'], 'xkey' => '', 'xorder' => '0', 'xkey_ext' => 'External patrol of property. No keys. See site list in photos. Phone Ideal Alarms once completed.', ]; $Xref->store($pParams); $pParams = [ 'source' => '#P', 'content_id' => $pDataHash['content_id'], 'xkey' => '08007 076595', 'xorder' => '1', 'xkey_ext' => NULL, ]; $Xref->store($pParams); $pParams = [ 'source' => '#P', 'content_id' => $pDataHash['content_id'], 'xkey' => $data[1], 'xorder' => '2', 'xkey_ext' => 'Property number', ]; $Xref->store($pParams); return( count( $this->mErrors ) == 0 ); } /** * Delete contact object and all related records */ function ContactDataExpunge() { $ret = FALSE; $query = "DELETE FROM `".BIT_DB_PREFIX."contact`"; $result = $this->mDb->query( $query ); // $query = "DELETE FROM `".BIT_DB_PREFIX."contact_address`"; // $result = $this->mDb->query( $query ); $query = "DELETE FROM `".BIT_DB_PREFIX."contact_xref`"; $result = $this->mDb->query( $query ); return $ret; } ?>