Example #1
0
    /**
     * Deletes an associated SignupFormAsDonation
     * @param SignupForm $objSignupForm
     * @return void
     */
    public function DeleteAssociatedSignupFormAsDonation(SignupForm $objSignupForm)
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateSignupFormAsDonation on this unsaved StewardshipFund.');
        }
        if (is_null($objSignupForm->Id)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateSignupFormAsDonation on this StewardshipFund with an unsaved SignupForm.');
        }
        // Get the Database Object for this Class
        $objDatabase = StewardshipFund::GetDatabase();
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`signup_form`
				WHERE
					`id` = ' . $objDatabase->SqlVariable($objSignupForm->Id) . ' AND
					`donation_stewardship_fund_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            $objSignupForm->Journal('DELETE');
        }
    }