| | |
| | | public function getServiceUser(string $service, ?int $userID = null):Integrations|false |
| | | { |
| | | $service = $this->getService($service); |
| | | if ($service->userID !== $userID && method_exists($service, 'switchUser')) { |
| | | if ($service->getUserID() !== $userID && method_exists($service, 'switchUser')) { |
| | | $service->switchUser($userID); |
| | | } |
| | | return $service; |
| | |
| | | |
| | | public function getAvailableServices():array |
| | | { |
| | | return array_filter(array_keys($this->serviceMap), function ($service) { |
| | | return Site::hasIntegration($service); |
| | | }, ARRAY_FILTER_USE_KEY); |
| | | return array_keys(Site::getIntegrations()); |
| | | } |
| | | } |