136 $typeList = static::getServiceTypes();
138 $providers = array();
139 foreach ($typeList as $type)
141 if ($types && !in_array($type, $types))
150 $service = static::getService();
151 $authAdapter = $service->getAuthAdapter($type);
152 $account = $service->getAccount($type);
153 $canUserMultiClients = $authAdapter->canUseMultipleClients();
155 $providers[$type] = array(
157 'HAS_AUTH' => $authAdapter->hasAuth(),
158 'AUTH_URL' => $authAdapter->getAuthUrl(),
159 'PROFILE' => $authAdapter->getToken() ? $account->getProfileCached() :
false,
160 'IS_SUPPORT_ACCOUNT' =>
true,
161 'ENGINE_CODE' => $service::getEngineCode($type)
163 if ($canUserMultiClients)
165 $providers[$type][
'CLIENTS'] = static::getClientsProfiles($authAdapter);
166 if (empty($providers[$type][
'CLIENTS']))
168 $providers[$type][
'HAS_AUTH'] =
false;
173 if ($providers[$type][
'HAS_AUTH'] && empty($providers[$type][
'PROFILE']))
175 static::removeAuth($type);
176 if (!$canUserMultiClients)
178 $providers[$type][
'HAS_AUTH'] =
false;
226 if (!static::canUse())
233 $account = static::getService()->getAccount($type);
234 $accountsResult = $account->getList();
235 if ($accountsResult->isSuccess())
237 while ($accountData = $accountsResult->fetch())
239 if ($accountData[
'ID'])
243 'id' => $accountData[
'ID'],
244 'name' => $accountData[
'NAME'] ? $accountData[
'NAME'] : $accountData[
'ID'],
245 'currency' => $accountData[
'CURRENCY'],
252 self::$errors = $accountsResult->getErrorMessages();
266 if (!static::canUse())
273 $account = static::getService()->getAccount($type);
274 $accountsResult = $account->getInstagramList();
275 if ($accountsResult->isSuccess())
277 while ($accountData = $accountsResult->fetch())
279 if ($accountData[
'ID'])
282 'id' => $accountData[
'ID'],
283 'name' => $accountData[
'NAME'] ? $accountData[
'NAME'] : $accountData[
'ID'],
284 'page_id' => $accountData[
'PAGE_ID'] ? $accountData[
'PAGE_ID'] : $accountData[
'ID'],
285 'actor_id' => $accountData[
'IG_ID']
292 self::$errors = $accountsResult->getErrorMessages();