Exemplo n.º 1
0
    /**
     * Deletes an associated SignupPayment
     * @param SignupPayment $objSignupPayment
     * @return void
     */
    public function DeleteAssociatedSignupPayment(SignupPayment $objSignupPayment)
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateSignupPayment on this unsaved SignupEntry.');
        }
        if (is_null($objSignupPayment->Id)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateSignupPayment on this SignupEntry with an unsaved SignupPayment.');
        }
        // Get the Database Object for this Class
        $objDatabase = SignupEntry::GetDatabase();
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`signup_payment`
				WHERE
					`id` = ' . $objDatabase->SqlVariable($objSignupPayment->Id) . ' AND
					`signup_entry_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            $objSignupPayment->Journal('DELETE');
        }
    }