src/Sulu/Bundle/ContactBundle/Controller/AccountController.php
public function getAction($id, Request $request)
    {
        $includes = explode(',', $request->get('include'));
        $accountManager = $this->getAccountManager();
        $locale = $this->getUser()->getLocale();

        try {
            $view = $this->responseGetById(
                $id,
                function($id) use ($includes, $accountManager, $locale) {
                    return $accountManager->getByIdAndInclude($id, $locale, $includes);
                }
            );

            $context = new Context();
            $context->setGroups(self::$accountSerializationGroups);
            $view->setContext($context);
        } catch (EntityNotFoundException $enfe) {
            $view = $this->view($enfe->toArray(), 404);
        }

        return $this->handleView($view);
    }
public function getAction($id, Request $request)
    {
        $includes = explode(',', $request->get('include'));
        $accountManager = $this->getAccountManager();
        $locale = $this->getUser()->getLocale();

        try {
            $view = $this->responseGetById(
                $id,
                function($id) use ($includes, $accountManager, $locale) {
                    return $accountManager->getByIdAndInclude($id, $locale, $includes);
                }
            );

            $context = new Context();
            $context->setGroups(self::$accountSerializationGroups);
            $view->setContext($context);
        } catch (EntityNotFoundException $enfe) {
            $view = $this->view($enfe->toArray(), 404);
        }

        return $this->handleView($view);
    }
public function getAction ( $ id , Request $ request ) { $ includes = explode ( ',' , $ request -> get ( 'include' ) ) ; $ accountManager = $ this -> getAccountManager ( ) ; $ locale = $ this -> getUser ( ) -> getLocale ( ) ; try { $ view = $ this -> responseGetById ( $ id , function ( $ id ) use ( $ includes , $ accountManager , $ locale ) { return $ accountManager -> getByIdAndInclude ( $ id , $ locale , $ includes ) ; } ) ; $ context = new Context ( ) ; $ context -> setGroups ( self :: $ accountSerializationGroups ) ; $ view -> setContext ( $ context ) ; } catch ( EntityNotFoundException $ enfe ) { $ view = $ this -> view ( $ enfe -> toArray ( ) , 404 ) ; } return $ this -> handleView ( $ view ) ; }
Shows a single account with the given id.

@param int $id
@param Request $request

@return Response
Shows a single account with the given id .