public function deleteAction(Request $request, Language $language): Response
    {
        $form = $this->formFactory->deleteLanguage(
            new LanguageDeleteData($language)
        );
        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (LanguageDeleteData $data) {
                $language = $data->getLanguage();
                $this->languageService->deleteLanguage($language);

                $this->notificationHandler->success(
                    $this->translator->trans(
                        /** @Desc("Language '%name%' removed.") */
                        'language.delete.success',
                        ['%name%' => $language->name],
                        'language'
                    )
                );
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        return $this->redirect($this->generateUrl('ezplatform.language.list'));
    }
public function deleteAction(Request $request, Language $language): Response
    {
        $form = $this->formFactory->deleteLanguage(
            new LanguageDeleteData($language)
        );
        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (LanguageDeleteData $data) {
                $language = $data->getLanguage();
                $this->languageService->deleteLanguage($language);

                $this->notificationHandler->success(
                    $this->translator->trans(
                        /** @Desc("Language '%name%' removed.") */
                        'language.delete.success',
                        ['%name%' => $language->name],
                        'language'
                    )
                );
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        return $this->redirect($this->generateUrl('ezplatform.language.list'));
    }
public function deleteAction ( Request $ request , Language $ language ) : Response { $ form = $ this -> formFactory -> deleteLanguage ( new LanguageDeleteData ( $ language ) ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) ) { $ result = $ this -> submitHandler -> handle ( $ form , function ( LanguageDeleteData $ data ) { $ language = $ data -> getLanguage ( ) ; $ this -> languageService -> deleteLanguage ( $ language ) ; $ this -> notificationHandler -> success ( $ this -> translator -> trans ( /** @Desc("Language '%name%' removed.") */ 'language.delete.success' , [ '%name%' => $ language -> name ] , 'language' ) ) ; } ) ; if ( $ result instanceof Response ) { return $ result ; } } return $ this -> redirect ( $ this -> generateUrl ( 'ezplatform.language.list' ) ) ; }
Deletes a language.

@param Request $request
@param Language $language

@return Response
Deletes a language .