/** * @param $userId * * @return AuthContainer */ public function createAuthContainer($userId) { $mediaPlatformId = $this->MediaPlatformUser->getMediaPlatformId($userId); if (empty($mediaPlatformId)) { throw new NotFoundException('Could not find the MediaPlatformUser #' . $userId); } $mediaPlatformAuthManagerFactory = new MediaPlatformAuthManagerFactory(); $authManager = $mediaPlatformAuthManagerFactory->createAuthManager($mediaPlatformId); $authContainer = $authManager->getAuthContainer($userId); $authContainer->userId = $userId; $authContainer->mediaPlatformId = $mediaPlatformId; return $authContainer; }
/** * @param $mediaPlatformId * * @return MediaPlatformAuthManager */ protected function _getAuthManager($mediaPlatformId) { $mediaPlatformAuthManagerFactory = new MediaPlatformAuthManagerFactory(); return $mediaPlatformAuthManagerFactory->createAuthManager($mediaPlatformId); }