/** * Deletes all associated FormAnswers * @return void */ public function DeleteAllFormAnswers() { if (is_null($this->intId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateFormAnswer on this unsaved SignupEntry.'); } // Get the Database Object for this Class $objDatabase = SignupEntry::GetDatabase(); // Journaling if ($objDatabase->JournalingDatabase) { foreach (FormAnswer::LoadArrayBySignupEntryId($this->intId) as $objFormAnswer) { $objFormAnswer->Journal('DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `form_answer` WHERE `signup_entry_id` = ' . $objDatabase->SqlVariable($this->intId) . ' '); }