public function createAction(
        string $contentTypeIdentifier,
        string $language,
        int $parentLocationId,
        Request $request
    ) {
        $contentType = $this->contentTypeService->loadContentTypeByIdentifier($contentTypeIdentifier);
        $location = $this->locationService->loadLocation($parentLocationId);
        $language = $this->languageService->loadLanguage($language);
        $parentGroup = $this->userService->loadUserGroup($location->contentId);

        $data = (new UserCreateMapper())->mapToFormData($contentType, [$parentGroup], [
            'mainLanguageCode' => $language->languageCode,
        ]);
        $form = $this->createForm(UserCreateType::class, $data, [
            'languageCode' => $language->languageCode,
            'mainLanguageCode' => $language->languageCode,
        ]);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid() && null !== $form->getClickedButton()) {
            $this->userActionDispatcher->dispatchFormAction($form, $data, $form->getClickedButton()->getName());
            if ($response = $this->userActionDispatcher->getResponse()) {
                return $response;
            }
        }

        return new UserCreateView(null, [
            'form' => $form->createView(),
            'language' => $language,
            'contentType' => $contentType,
            'parentGroup' => $parentGroup,
        ]);
    }
public function createAction(
        string $contentTypeIdentifier,
        string $language,
        int $parentLocationId,
        Request $request
    ) {
        $contentType = $this->contentTypeService->loadContentTypeByIdentifier($contentTypeIdentifier);
        $location = $this->locationService->loadLocation($parentLocationId);
        $language = $this->languageService->loadLanguage($language);
        $parentGroup = $this->userService->loadUserGroup($location->contentId);

        $data = (new UserCreateMapper())->mapToFormData($contentType, [$parentGroup], [
            'mainLanguageCode' => $language->languageCode,
        ]);
        $form = $this->createForm(UserCreateType::class, $data, [
            'languageCode' => $language->languageCode,
            'mainLanguageCode' => $language->languageCode,
        ]);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid() && null !== $form->getClickedButton()) {
            $this->userActionDispatcher->dispatchFormAction($form, $data, $form->getClickedButton()->getName());
            if ($response = $this->userActionDispatcher->getResponse()) {
                return $response;
            }
        }

        return new UserCreateView(null, [
            'form' => $form->createView(),
            'language' => $language,
            'contentType' => $contentType,
            'parentGroup' => $parentGroup,
        ]);
    }
public function createAction ( string $ contentTypeIdentifier , string $ language , int $ parentLocationId , Request $ request ) { $ contentType = $ this -> contentTypeService -> loadContentTypeByIdentifier ( $ contentTypeIdentifier ) ; $ location = $ this -> locationService -> loadLocation ( $ parentLocationId ) ; $ language = $ this -> languageService -> loadLanguage ( $ language ) ; $ parentGroup = $ this -> userService -> loadUserGroup ( $ location -> contentId ) ; $ data = ( new UserCreateMapper ( ) ) -> mapToFormData ( $ contentType , [ $ parentGroup ] , [ 'mainLanguageCode' => $ language -> languageCode , ] ) ; $ form = $ this -> createForm ( UserCreateType :: class , $ data , [ 'languageCode' => $ language -> languageCode , 'mainLanguageCode' => $ language -> languageCode , ] ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) && null !== $ form -> getClickedButton ( ) ) { $ this -> userActionDispatcher -> dispatchFormAction ( $ form , $ data , $ form -> getClickedButton ( ) -> getName ( ) ) ; if ( $ response = $ this -> userActionDispatcher -> getResponse ( ) ) { return $ response ; } } return new UserCreateView ( null , [ 'form' => $ form -> createView ( ) , 'language' => $ language , 'contentType' => $ contentType , 'parentGroup' => $ parentGroup , ] ) ; }
Displays and processes a user creation form.

@param string $contentTypeIdentifier ContentType id to create
@param string $language Language code to create the content in (eng-GB, ger-DE, ...))
@param int $parentLocationId Location the content should be a child of
@param Request $request

@return UserCreateView|Response

@throws InvalidArgumentType
@throws InvalidArgumentException
@throws UnauthorizedException
@throws UndefinedOptionsException
@throws OptionDefinitionException
@throws NoSuchOptionException
@throws MissingOptionsException
@throws InvalidOptionsException
@throws AccessException
@throws NotFoundException
Displays and processes a user creation form .