/** * Deletes all associated FormProducts * @return void */ public function DeleteAllFormProducts() { if (is_null($this->intId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateFormProduct on this unsaved SignupForm.'); } // Get the Database Object for this Class $objDatabase = SignupForm::GetDatabase(); // Journaling if ($objDatabase->JournalingDatabase) { foreach (FormProduct::LoadArrayBySignupFormId($this->intId) as $objFormProduct) { $objFormProduct->Journal('DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `form_product` WHERE `signup_form_id` = ' . $objDatabase->SqlVariable($this->intId) . ' '); }