src/snac/server/ServerExecutor.php
/**
     * Update Group Information
     *
     * Updates the group information passed in to the server
     *
     * @param  string[] $input Input from the client
     * @return string[] Response to the client
     */
Update Group Information
Updates the group information passed in to the server

@param  string[] $input Input from the client
@return string[] Response to the client
Update Group Information Updates the group information passed in to the server @param string [] $input Input from the client @return string [] Response to the client
public function updateGroupInformation($input = null) {
        $response = array();
        $updated = new \snac\data\Group($input["group_update"]);
        $updated = $this->uStore->writeGroup($updated);
        $currentUsers = $this->uStore->listUsersInGroup($updated);
        foreach ($currentUsers as $current) {
            $this->uStore->removeUserFromGroup($current, $updated);
        }
        foreach ($input["users_update"] as $newUser) {
            $this->uStore->addUserToGroup(new \snac\data\User($newUser), $updated);
        }
        if ($updated === false) {
            $response["result"] = "failure";
            $response["error"] = "Could not save the group";
        } else {
            $response["result"] = "success";
            $response["group_update"] = $updated->toArray();
        }
        return $response;
    }
public function updateGroupInformation ( $ input = null ) { $ response = array ( ) ; $ updated = new \ snac \ data \ Group ( $ input [ " group_update " ] ) ; $ updated = $ this -> uStore -> writeGroup ( $ updated ) ; $ currentUsers = $ this -> uStore -> listUsersInGroup ( $ updated ) ; foreach ( $ currentUsers as $ current ) { $ this -> uStore -> removeUserFromGroup ( $ current , $ updated ) ; } foreach ( $ input [ " users_update " ] as $ newUser ) { $ this -> uStore -> addUserToGroup ( new \ snac \ data \ User ( $ newUser ) , $ updated ) ; } if ( $ updated === false ) { $ response [ " result " ] = " failure " ; $ response [ " error " ] = " Could not save the group " ; } else { $ response [ " result " ] = " success " ; $ response [ " group_update " ] = $ updated -> toArray ( ) ; } return $ response ; }
Update Group Information
 Updates the group information passed in to the server
Update Group Information Updates the group information passed in to the server