/** * Unassociates all People * @return void */ public function UnassociateAllPeople() { if (is_null($this->intId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateAllPersonArray on this unsaved CheckingAccountLookup.'); } // Get the Database Object for this Class $objDatabase = CheckingAccountLookup::GetDatabase(); // Journaling (if applicable) if ($objDatabase->JournalingDatabase) { $objResult = $objDatabase->Query('SELECT `person_id` AS associated_id FROM `checkingaccountlookup_person_assn` WHERE `checking_account_lookup_id` = ' . $objDatabase->SqlVariable($this->intId)); while ($objRow = $objResult->GetNextRow()) { $this->JournalPersonAssociation($objRow->GetColumn('associated_id'), 'DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `checkingaccountlookup_person_assn` WHERE `checking_account_lookup_id` = ' . $objDatabase->SqlVariable($this->intId) . ' '); }