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