getPersonalWorkspaceNameForUsername() 공개 정적인 메소드

Constructs a personal workspace name for the user with the given username.
public static getPersonalWorkspaceNameForUsername ( string $username ) : string
$username string
리턴 string
 /**
  * Returns the name of the currently logged in user's personal workspace (even if that might not exist at that time).
  * If no user is logged in this method returns null.
  *
  * @return string
  * @api
  */
 public function getPersonalWorkspaceName()
 {
     $currentUser = $this->userDomainService->getCurrentUser();
     if (!$currentUser instanceof User) {
         return null;
     }
     $username = $this->userDomainService->getUsername($currentUser);
     return $username === null ? null : UserUtility::getPersonalWorkspaceNameForUsername($username);
 }
 /**
  * Removes all personal workspaces of the given user's account if these workspaces exist. Also removes
  * all possibly existing content of these workspaces.
  *
  * @param string $accountIdentifier Identifier of the user's account
  * @return void
  */
 protected function deletePersonalWorkspace($accountIdentifier)
 {
     $userWorkspace = $this->workspaceRepository->findByIdentifier(UserUtility::getPersonalWorkspaceNameForUsername($accountIdentifier));
     if ($userWorkspace instanceof Workspace) {
         $this->publishingService->discardAllNodes($userWorkspace);
         $this->workspaceRepository->remove($userWorkspace);
     }
 }
 /**
  * Rebase the current users personal workspace onto the given $targetWorkspace and then
  * redirects to the $targetNode in the content module.
  *
  * @param NodeInterface $targetNode
  * @param Workspace $targetWorkspace
  * @return void
  */
 public function rebaseAndRedirectAction(NodeInterface $targetNode, Workspace $targetWorkspace)
 {
     $currentAccount = $this->securityContext->getAccount();
     $personalWorkspace = $this->workspaceRepository->findOneByName(UserUtility::getPersonalWorkspaceNameForUsername($currentAccount->getAccountIdentifier()));
     /** @var Workspace $personalWorkspace */
     if ($personalWorkspace !== $targetWorkspace) {
         if ($this->publishingService->getUnpublishedNodesCount($personalWorkspace) > 0) {
             $message = $this->translator->translateById('workspaces.cantEditBecauseWorkspaceContainsChanges', [], null, null, 'Modules', 'Neos.Neos');
             $this->addFlashMessage($message, '', Message::SEVERITY_WARNING, [], 1437833387);
             $this->redirect('show', null, null, ['workspace' => $targetWorkspace]);
         }
         $personalWorkspace->setBaseWorkspace($targetWorkspace);
         $this->workspaceRepository->update($personalWorkspace);
     }
     $contextProperties = $targetNode->getContext()->getProperties();
     $contextProperties['workspaceName'] = $personalWorkspace->getName();
     $context = $this->contextFactory->create($contextProperties);
     $mainRequest = $this->controllerContext->getRequest()->getMainRequest();
     /** @var ActionRequest $mainRequest */
     $this->uriBuilder->setRequest($mainRequest);
     $this->redirect('show', 'Frontend\\Node', 'Neos.Neos', ['node' => $context->getNode($targetNode->getPath())]);
 }