示例#1
0
    /**
     * Deletes all associated StewardshipContributions
     * @return void
     */
    public function DeleteAllStewardshipContributions()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateStewardshipContribution on this unsaved Person.');
        }
        // Get the Database Object for this Class
        $objDatabase = Person::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (StewardshipContribution::LoadArrayByPersonId($this->intId) as $objStewardshipContribution) {
                $objStewardshipContribution->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`stewardship_contribution`
				WHERE
					`person_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }