コード例 #1
0
ファイル: PaypalBatchGen.class.php プロジェクト: alcf/chms
    /**
     * Deletes all associated CreditCardPayments
     * @return void
     */
    public function DeleteAllCreditCardPayments()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateCreditCardPayment on this unsaved PaypalBatch.');
        }
        // Get the Database Object for this Class
        $objDatabase = PaypalBatch::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (CreditCardPayment::LoadArrayByPaypalBatchId($this->intId) as $objCreditCardPayment) {
                $objCreditCardPayment->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`credit_card_payment`
				WHERE
					`paypal_batch_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }