示例#1
0
    /**
     * Deletes all associated OnlineDonationsAsRecurringPayment
     * @return void
     */
    public function DeleteAllOnlineDonationsAsRecurringPayment()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateOnlineDonationAsRecurringPayment on this unsaved RecurringPayments.');
        }
        // Get the Database Object for this Class
        $objDatabase = RecurringPayments::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (OnlineDonation::LoadArrayByRecurringPaymentId($this->intId) as $objOnlineDonation) {
                $objOnlineDonation->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`online_donation`
				WHERE
					`recurring_payment_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }