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