Create and store in database new group model instance

@param string $token   group token
@param array  $options additional column values

@return \ViKon\Auth\Model\Group
558793
protected function createGroupModel($token, array $options = [])
    {
        $group = $this->newGroupModel($token, $options);
        $group->save();

        return $group;
    }
450834
public static function fromToken(TokenInterface $token)
    {
        $user = $token->getUser();

        if ($user instanceof GroupableInterface) {
            $sids = [];
            $groups = $user->getGroups();

            foreach ($groups as $group) {
                $sids[] = self::fromAccount($group);
            }

            return $sids;
        }

        throw new InvalidArgumentException('The user class must implement "Fxp\Component\Security\Model\Traits\GroupableInterface"');
    }
948141
public function groupDelete($groupId, $options=array()){

        $data = array();
        
        $data['group_id'] = $groupId;

        $data = array_merge($data, $options);

        return $this->request($this->groupDeleteUrl, $data);
    }
909269
public function groupAdd($groupId, $options=array()){

        $data = array();
        
        $data['group_id'] = $groupId;

        $data = array_merge($data, $options);

        return $this->request($this->groupAddUrl, $data);
    }
1305863
protected function createMember(AccessToken $token, AbstractProvider $provider)
    {
        $session = $this->getSession();
        $providerName = $session->get('oauth2.provider');
        $user = $provider->getResourceOwner($token);

        /** @var Member|MemberExtension $member */
        $member = Member::create();
        $member = $this->getMapper($providerName)->map($member, $user);
        $member->OAuthSource = $providerName;
        $member->write();

        return $member;
    }
5041
public function createBucket($bucketName, $options = [])
    {
        $this->beginProfile($token = "    > create bucket $bucketName ...");

        $this->db->createBucket($bucketName, $options);

        $this->endProfile($token);
    }
1318365
private function getToken($token, &$hasSeenBy)
    {
        switch ($token) {
            case 'And':
                return new AndToken();
            case 'Or':
                return new OrToken();
            case 'By':
            case 'Where':
                $hasSeenBy = true;
                return new ByToken();
            case 'All':
                return new AllToken();
            case 'Distinct':
                if ($hasSeenBy) {
                    return new ValueToken($token);
                } else {
                    return new DistinctToken();
                }
            case 'Like':
                if ($hasSeenBy) {
                    return new LikeToken();
                } else {
                    return new ValueToken($token);
                }
            default:
                return new ValueToken($token);
        }
    }
492646
public function setAuthToken($token)
    {
        $this->apiClient
            ->setShopId(null)
            ->setShopPassword(null)
            ->setBearerToken($token);

        return $this;
    }
470995
public function create($data, $token = null)
    {
        if (isset($token)) {
            return $this->client()->put($data, 'password-tokens/{token}', ['token' => $token]);
        }

        return $this->client()->post($data, 'password-tokens');
    }
619674
public function setToken($token)
    {
        $token = trim($token);

        $this->isChanged('token', $token);

        $this->token = $token;

        return $this;
    }
168713
public function create($token = null)
    {
        if ($token) {
            $this->model->setToken($token);
        }

        return $this->request->create($this->model);
    }
598448
public function CreateGroup(\Google\Cloud\Monitoring\V3\CreateGroupRequest $argument,
      $metadata = [], $options = []) {
        return $this->_simpleRequest('/google.monitoring.v3.GroupService/CreateGroup',
        $argument,
        ['\Google\Cloud\Monitoring\V3\Group', 'decode'],
        $metadata, $options);
    }
581382
public function setGroup($group)
	{
	    if ($this->options['group']) {
	        $group = str_replace('//', '/', $this->options['group'] . '/' . $group);
	    }
	    
	    return $this->setOption('group', $group);
	}
261506
public function generateUrl($url, $token, $options, $availableOptions)
    {

        // Append client id
        $url .= (parse_url($url, PHP_URL_QUERY) ? '&' : '?').'client_id='.$this->getClientId();

        // Append token if provided
        if ($token) {
            $url .= (parse_url($url, PHP_URL_QUERY) ? '&' : '?').'oauth_token='.$this->getToken($token);
        }

        // Add options to the URL
        foreach ($options as $key => $value) {
            $url .= (parse_url($url, PHP_URL_QUERY) ? '&' : '?').$key.'='.$value;
        }

        return $url;
    }
311994
public function addOption(Option $option, $group = null)
    {
        $options = [$option];

        if ($group === null) {
            $group = $this->currentGroup;
        }

        $this->setOptions($options, $group);

        return $this;
    }
1339712
public function withToken(Token $token)
    {
        $this->grant = 'provided_token';
        $this->token = new AccessToken([
            'access_token' => $token->jwt(),
            'expires' => $token->expires()->timestamp,
        ]);

        return $this;
    }
222349
protected function createToken(array $tokenConfig = [])
    {
        if (!array_key_exists('class', $tokenConfig)) {
            $tokenConfig['class'] = OAuthToken::className();
        }
        return Yii::createObject($tokenConfig);
    }