src/Sulu/Bundle/PageBundle/Controller/WebspaceLocalizationController.php
public function cgetAction(Request $request)
    {
        $webspaceKey = $request->get('webspace');

        /** @var WebspaceManagerInterface $webspaceManager */
        $webspaceManager = $this->get('sulu_core.webspace.webspace_manager');

        $webspace = $webspaceManager->findWebspaceByKey($webspaceKey);

        if ($webspace) {
            $localizations = new CollectionRepresentation($webspace->getAllLocalizations(), 'localizations');
            $view = $this->view($localizations, 200);
        } else {
            $error = new RestException(sprintf('No webspace found for key \'%s\'', $webspaceKey));
            $view = $this->view($error->toArray(), 400);
        }

        return $this->handleView($view);
    }
public function cgetAction(Request $request)
    {
        $webspaceKey = $request->get('webspace');

        /** @var WebspaceManagerInterface $webspaceManager */
        $webspaceManager = $this->get('sulu_core.webspace.webspace_manager');

        $webspace = $webspaceManager->findWebspaceByKey($webspaceKey);

        if ($webspace) {
            $localizations = new CollectionRepresentation($webspace->getAllLocalizations(), 'localizations');
            $view = $this->view($localizations, 200);
        } else {
            $error = new RestException(sprintf('No webspace found for key \'%s\'', $webspaceKey));
            $view = $this->view($error->toArray(), 400);
        }

        return $this->handleView($view);
    }
public function cgetAction ( Request $ request ) { $ webspaceKey = $ request -> get ( 'webspace' ) ; /** @var WebspaceManagerInterface $webspaceManager */ $ webspaceManager = $ this -> get ( 'sulu_core.webspace.webspace_manager' ) ; $ webspace = $ webspaceManager -> findWebspaceByKey ( $ webspaceKey ) ; if ( $ webspace ) { $ localizations = new CollectionRepresentation ( $ webspace -> getAllLocalizations ( ) , 'localizations' ) ; $ view = $ this -> view ( $ localizations , 200 ) ; } else { $ error = new RestException ( sprintf ( 'No webspace found for key \'%s\'' , $ webspaceKey ) ) ; $ view = $ this -> view ( $ error -> toArray ( ) , 400 ) ; } return $ this -> handleView ( $ view ) ; }
Returns the localizations for the given webspace.

@param Request $request

@return \Symfony\Component\HttpFoundation\Response
Returns the localizations for the given webspace .