Ejemplo n.º 1
0
    /**
     * Deletes all associated GroupParticipations
     * @return void
     */
    public function DeleteAllGroupParticipations()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateGroupParticipation on this unsaved Person.');
        }
        // Get the Database Object for this Class
        $objDatabase = Person::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (GroupParticipation::LoadArrayByPersonId($this->intId) as $objGroupParticipation) {
                $objGroupParticipation->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`group_participation`
				WHERE
					`person_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }