Beispiel #1
0
    /**
     * Deletes an associated StewardshipPledge
     * @param StewardshipPledge $objStewardshipPledge
     * @return void
     */
    public function DeleteAssociatedStewardshipPledge(StewardshipPledge $objStewardshipPledge)
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateStewardshipPledge on this unsaved Person.');
        }
        if (is_null($objStewardshipPledge->Id)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateStewardshipPledge on this Person with an unsaved StewardshipPledge.');
        }
        // Get the Database Object for this Class
        $objDatabase = Person::GetDatabase();
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`stewardship_pledge`
				WHERE
					`id` = ' . $objDatabase->SqlVariable($objStewardshipPledge->Id) . ' AND
					`person_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            $objStewardshipPledge->Journal('DELETE');
        }
    }