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