36 public static function registerGroup(
string $type,
string $groupId): bool
38 return Form::create($type)
39 ->setService(static::getInstance())
40 ->registerGroup($groupId);
52 return $instance = $instance ??
new static();
65 $result = Form::create($type)
66 ->setService(static::getInstance())
67 ->unRegisterGroup($groupId);
69 static::getInstance()->getGroupAuth($type)->removeAuth();
80 public static function getAuthAdapter($type):
AuthAdapter
85 $adapters = $adapters ?? [];
86 if (!array_key_exists($type, $adapters))
88 $adapters[$type] = AuthAdapter::create($type)->
setService(static::getInstance());
91 return $adapters[$type];
99 foreach (static::getTypes() as $type)
101 if ($engineCode === static::getEngineCode($type))
118 static::TYPE_FACEBOOK,
119 static::TYPE_VKONTAKTE,
131 return static::GROUP .
'.' . $type;
159 return $this->
getForm($type)->getGroupAuthAdapter();
171 if (!array_key_exists($type, $this->forms))
173 $this->forms[$type] = Form::create($type)->
setService($this);
176 return $this->forms[$type];
188 if (!array_key_exists($type, $this->accounts))
190 $this->accounts[$type] = Account::create($type)->
setService($this);
193 return $this->accounts[$type];
198 $authManager = static::getAuthAdapter($type);
199 return $authManager->getAuthUrl();
static getEngineCode($type)
static unRegisterGroup(string $type, string $groupId)
static registerGroup(string $type, string $groupId)
static getTypeByEngine(string $engineCode)
static canUseAsInternal()
getGroupAuth(string $type)
setService(IService $service)
setService(IService $service)