/** * Unassociates all CommunicationLists * @return void */ public function UnassociateAllCommunicationLists() { if (is_null($this->intId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateAllCommunicationListArray on this unsaved CommunicationListEntry.'); } // Get the Database Object for this Class $objDatabase = CommunicationListEntry::GetDatabase(); // Journaling (if applicable) if ($objDatabase->JournalingDatabase) { $objResult = $objDatabase->Query('SELECT `communication_list_id` AS associated_id FROM `communicationlist_communicationlistentry_assn` WHERE `communication_list_entry_id` = ' . $objDatabase->SqlVariable($this->intId)); while ($objRow = $objResult->GetNextRow()) { $this->JournalCommunicationListAssociation($objRow->GetColumn('associated_id'), 'DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `communicationlist_communicationlistentry_assn` WHERE `communication_list_entry_id` = ' . $objDatabase->SqlVariable($this->intId) . ' '); }