Exemplo n.º 1
0
    /**
     * Deletes all associated SignupFormsAsDonation
     * @return void
     */
    public function DeleteAllSignupFormsAsDonation()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateSignupFormAsDonation on this unsaved StewardshipFund.');
        }
        // Get the Database Object for this Class
        $objDatabase = StewardshipFund::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (SignupForm::LoadArrayByDonationStewardshipFundId($this->intId) as $objSignupForm) {
                $objSignupForm->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`signup_form`
				WHERE
					`donation_stewardship_fund_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }