Обновляет группу пользователей
@param $groupId
@param array $fields
@return int
@throws \Sprint\Migration\Exceptions\HelperException
194039
public function updateGroup($groupId, $fields = array()) {
        if (empty($fields)) {
            $this->throwException(__METHOD__, 'Set fields for group');
        }

        $group = new \CGroup;
        if ($group->Update($groupId, $this->prepareFields($fields))) {
            return intval($groupId);
        }

        $this->throwException(__METHOD__, $group->LAST_ERROR);
    }
178316
public function stepCreateMemberWithGroup($id, $groupId) {
		$group = $this->fixtureFactory->get('Group', $groupId);
		if(!$group) $group = $this->fixtureFactory->createObject('Group', $groupId);
		
		$member = $this->fixtureFactory->createObject('Member', $id);
		$member->Groups()->add($group);
	}
227792
public function groupQuit($userId, $groupId) {
        try{
            if(empty($userId))
                throw new Exception('被同步群信息的用户 Id 不能为空');
            if(empty($groupId))
                throw new Exception('加入的群 Id 不能为空');
            $ret = $this->curl('/group/quit',
                array('userId' => $userId, "groupId" => $groupId)
            );
            if(empty($ret))
                throw new Exception('请求失败');
            return $ret;
        }catch (Exception $e) {
            print_r($e->getMessage());
        }
    }
1165183
public function groupUserQuery( $groupId ) {
        try{
            if(empty($groupId))
                throw new Exception('要加入的群 Id 不能为空');
            $ret = $this->curl('/group/user/query',
                    array('groupId' => $groupId)
            );
            if(empty($ret))
                throw new Exception('请求失败');
            return $ret;
        }catch (Exception $e) {
            print_r($e->getMessage());
        }
    }
272133
public function loadObjectStateListData($groupId)
    {
        try {
            return $this->innerGateway->loadObjectStateListData($groupId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
224848
public static function fetchByGroup( $groupID, $limit = false, $offset = false )
    {
        return self::fetchByConditions( array( "ezcobj_state_group.id=$groupID" ), $limit, $offset );
    }
672293
public function sendGetGroupV2Info($groupID)
    {
        $msgId = $this->nodeId['get_groupv2_info'] = $this->createIqId();

        $queryNode = new ProtocolNode('query',
            [
                'request' => 'interactive',
            ], null, null);

        $node = new ProtocolNode('iq',
            [
                'id'    => $msgId,
                'xmlns' => 'w:g2',
                'type'  => 'get',
                'to'    => $this->getJID($groupID),
            ], [$queryNode], null);

        $this->sendNode($node);
    }
1313927
public function write(array $fields): int
    {
        $options = $this->getCsvControl();
        $delimiter = $options[0];
        $enclosure = $options[1];
        if (!empty($enclosure)) {
            return $this->fputcsv($fields, $delimiter, $enclosure);
        }

        $fields = array_map(function ($field) use ($delimiter) {
            return str_replace([$delimiter, PHP_EOL], ['', ''], $field);
        }, $fields);

        return $this->fwrite(implode($delimiter, $fields) . PHP_EOL);
    }
1199812
public function leaveGroup($groupId)
	{
		$token = $this->oauth->getToken();

		// Set parameters.
		$parameters = array(
			'oauth_token' => $token['key'],
		);

		// Set the success response code.
		$this->oauth->setOption('success_code', 204);

		// Set the API base
		$base = '/v1/people/~/group-memberships/' . $groupId;

		// Build the request path.
		$path = $this->getOption('api.url') . $base;

		// Send the request.
		$response = $this->oauth->oauthRequest($path, 'DELETE', $parameters);

		return $response;
	}
647810
private function setRequired(array $fields, string $groupName = null): array
    {
        foreach ($fields as $fieldName => $field) {
            if (!empty($field['required'])) {
                if (isset($field['groups']) && !is_array($field['groups'])) {
                    $field['groups'] = [$field['groups']];
                }
                if (empty($field['groups']) || in_array($groupName, $field['groups'])) {
                    $fields[$fieldName] = $this->makeRequired($fields[$fieldName]);
                }
            }
        }

        return $fields;
    }
421634
public function setGroupId( $groupId )
    {
        $this->groupId = (int) $groupId ?: null;

        if ( $this->group && $this->group->id != $this->groupId )
        {
            $this->group = null;
        }

        return $this;
    }
1029366
public function updateGroup($groupId, Api\GroupUpdate $group)
    {
        $json = Serialize::groupUpdate($group);
        $result = $this->_post($this->_groupUrl($groupId), $json);
        return Deserialize::groupResponse($result);
    }
1223269
public function fetchGroupMembers($groupId)
    {
        $result = $this->_get($this->_groupUrl($groupId, '/members'));
        return Deserialize::groupMembers($result);
    }
975141
public function groupEdit($group_id, $group_name = "", $group_description = "", $max_user = 0)
    {
        $url    = $this->url.'chatgroups/'.$group_id;
        $option = [
            "groupname"   => self::stringReplace($group_name),
            "description" => self::stringReplace($group_description),
            "maxusers"    => $max_user,
        ];
        $option = array_filter($option);
        if (empty($option)) {
            throw new EasemobError('提交修改的参数，不修改提交空！');
        }

        $access_token = $this->getToken();
        $header []    = 'Authorization: Bearer '.$access_token;

        return Http::postCurl($url, $option, $header, 'PUT');
    }
13733
public function updateGroup($groupId, InputStruct $input)
    {
        $objectStateGroup = $this->objectStateMapper->createObjectStateGroupFromInputStruct($input);
        $objectStateGroup->id = (int)$groupId;

        $this->objectStateGateway->updateObjectStateGroup($objectStateGroup);

        return $this->loadGroup($objectStateGroup->id);
    }
849986
public function findId($id, $fields = '', $fetchMode=PDO::FETCH_ASSOC) {
		if (!empty($fields)) $this->driver->field($fields);
		return $this->driver->where($this->driver->id.'=?', $id)
            ->fetch($fetchMode);
	}
959403
public function group($fields)
    {
        if (!$fields) {
            return $this;
        }
        if ($fields = is_array($fields) ? $fields : func_get_args()) {
            $this->_parts['group'] = array_merge($this->_parts['group'], array_fill_keys($fields, true));
        }
        return $this;
    }