grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026beanManager = $beanManager; $this->attributeHelper = $attributeHelper; $this->relationshipHelper = $relationshipHelper; } /** * * @param Request $request * @return DocumentResponse */ public function getCurrentUser(Request $request) { $oauth2Token = $this->beanManager->newBeanSafe('OAuth2Tokens'); $oauth2Token->retrieve_by_string_fields( ['access_token' => $request->getAttribute('oauth_access_token_id')] ); $currentUser = $this->beanManager->getBeanSafe('Users', $oauth2Token->assigned_user_id); $currentUserData = $currentUser->toArray(); unset($currentUserData['user_hash']); $dataResponse = new DataResponse($currentUser->getObjectName(), $currentUser->id); $attributeResponse = new AttributeResponse($currentUserData); $dataResponse->setAttributes($attributeResponse); $dataResponse->setRelationships($this->relationshipHelper->getRelationships($currentUser, $request->getUri()->getPath())); $response = new DocumentResponse(); $response->setData($dataResponse); return $response; } }