src/snac/server/database/SQL.php
/**
     * Really delete a group
     *
     * Used for testing only, maybe. In any case, deleting a group should be rare. To make this a little safer
     * it only deletes if the group is not in use.
     *
     * @throws \snac\exceptions\SNACDatabaseException
     *
     * @param integer $groupID An group id
     */
Really delete a group
Used for testing only, maybe. In any case, deleting a group should be rare. To make this a little safer
it only deletes if the group is not in use.



@param integer $groupID An group id
Really delete a group Used for testing only maybe . In any case deleting a group should be rare . To make this a little safer it only deletes if the group is not in use . @param integer $groupID An group id
public function deleteGroup($groupID)
    {
        $result = $this->sdb->query(
            'select email from appuser, appuser_group_link as agl where agl.gid=$1 and agl.uid=appuser.id',
            array($groupID));
        $email = "";
        while($row = $this->sdb->fetchrow($result))
        {
            $email .= $row['email'] . " ";
        }
        if ($email)
        {
            throw new \snac\exceptions\SNACDatabaseException("Tried to delete group still used by user(s): $email");
        }
        else
        {
            $this->sdb->query(
                'delete from appuser_group where id=$1 and id not in (select distinct(gid) from appuser_group_link)',
                array($groupID));
        }
    }
public function deleteGroup ( $ groupID ) { $ result = $ this -> sdb -> query ( 'select email from appuser, appuser_group_link as agl where agl.gid=$1 and agl.uid=appuser.id' , array ( $ groupID ) ) ; $ email = " " ; while ( $ row = $ this -> sdb -> fetchrow ( $ result ) ) { $ email .= $ row [ 'email' ] . " " ; } if ( $ email ) { throw new \ snac \ exceptions \ SNACDatabaseException ( " Tried to delete group still used by user(s):  $ email " ) ; } else { $ this -> sdb -> query ( 'delete from appuser_group where id=$1 and id not in (select distinct(gid) from appuser_group_link)' , array ( $ groupID ) ) ; } }
Really delete a group
 Used for testing only, maybe.
Really delete a group Used for testing only maybe .