Beispiel #1
0
    /**
     * Deletes all associated StewardshipPledges
     * @return void
     */
    public function DeleteAllStewardshipPledges()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateStewardshipPledge on this unsaved StewardshipFund.');
        }
        // Get the Database Object for this Class
        $objDatabase = StewardshipFund::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (StewardshipPledge::LoadArrayByStewardshipFundId($this->intId) as $objStewardshipPledge) {
                $objStewardshipPledge->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`stewardship_pledge`
				WHERE
					`stewardship_fund_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }