public function updateUser($userId, Request $request)
{
$user = $this->userService->loadUser($userId);
$updateStruct = $this->inputDispatcher->parse(new Message(array('Content-Type' => $request->headers->get('Content-Type'), 'Url' => $request->getPathInfo()), $request->getContent()));
if ($updateStruct->sectionId !== null) {
$section = $this->sectionService->loadSection($updateStruct->sectionId);
$this->sectionService->assignSection($user->getVersionInfo()->getContentInfo(), $section);
}
$updatedUser = $this->userService->updateUser($user, $updateStruct->userUpdateStruct);
$updatedContentInfo = $updatedUser->getVersionInfo()->getContentInfo();
$mainLocation = $this->locationService->loadLocation($updatedContentInfo->mainLocationId);
$contentType = $this->contentTypeService->loadContentType($updatedContentInfo->contentTypeId);
return new Values\RestUser($updatedUser, $contentType, $updatedContentInfo, $mainLocation, $this->contentService->loadRelations($updatedUser->getVersionInfo()));
}