response->getStatus() !== ServerStatus::OK) { return; } $json = json_decode($this->requestBody); try { $sharing = new Sharing(); $sharing->setUserId($json->userId); $sharing->setUserShared($json->userSharedId); $sharing->Save(); $this->response = new ApiJsonResponse(); $this->response->setParameter('sharingId', $sharing->getSharingId()); } catch (Throwable $e) { $this->response = new ApiJsonResponse(ServerStatus::BAD_REQUEST); $this->response->setMessage($e->getMessage()); } } }