/** * Deletes all associated RecurringPaymentses * @return void */ public function DeleteAllRecurringPaymentses() { if (is_null($this->intId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateRecurringPayments on this unsaved PaymentPeriod.'); } // Get the Database Object for this Class $objDatabase = PaymentPeriod::GetDatabase(); // Journaling if ($objDatabase->JournalingDatabase) { foreach (RecurringPayments::LoadArrayByPaymentPeriodId($this->intId) as $objRecurringPayments) { $objRecurringPayments->Journal('DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `recurring_payments` WHERE `payment_period_id` = ' . $objDatabase->SqlVariable($this->intId) . ' '); }