| | |
| | | use JVBase\rest\routes\AdminRoutes; |
| | | use JVBase\rest\routes\IntegrationsRoutes; |
| | | use JVBase\base\SchemaHelper; |
| | | use UserRoutes; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | |
| | | 'queue' => new QueueRoutes(), |
| | | 'settings' => new SettingsRoutes(), |
| | | 'upload' => new UploadRoutes(), |
| | | 'forms' => new FormRoutes() |
| | | 'forms' => new FormRoutes(), |
| | | 'user' => new UserRoutes() |
| | | ]; |
| | | |
| | | if (Site::has('magic_link')) { |
| | |
| | | protected function setupIntegrations(): void |
| | | { |
| | | foreach(array_keys(Site::getIntegrations()) as $integration) { |
| | | $this->integrations[$integration] = new $this->serviceMap[$integration](); |
| | | $this->integrations[$integration] = $this->serviceMap[$integration]::getInstance(); |
| | | } |
| | | } |
| | | |
| | |
| | | if (!array_key_exists($service, $this->integrations)) { |
| | | return null; |
| | | } |
| | | return new $this->serviceMap[$service]($userID); |
| | | return $this->serviceMap[$service]::getInstance($userID); |
| | | } |
| | | return (array_key_exists($service, $this->integrations)) ? $this->integrations[$service] : null; |
| | | } |