src/Sulu/Bundle/ContactBundle/Controller/ContactController.php
public function getAction($id)
    {
        $contactManager = $this->getContactManager();
        $locale = $this->getUser()->getLocale();

        try {
            $view = $this->responseGetById(
                $id,
                function($id) use ($contactManager, $locale) {
                    return $contactManager->getById($id, $locale);
                }
            );

            $context = new Context();
            $context->setGroups(static::$contactSerializationGroups);
            $view->setContext($context);
        } catch (EntityNotFoundException $e) {
            $view = $this->view($e->toArray(), 404);
        }

        return $this->handleView($view);
    }
public function getAction($id)
    {
        $contactManager = $this->getContactManager();
        $locale = $this->getUser()->getLocale();

        try {
            $view = $this->responseGetById(
                $id,
                function($id) use ($contactManager, $locale) {
                    return $contactManager->getById($id, $locale);
                }
            );

            $context = new Context();
            $context->setGroups(static::$contactSerializationGroups);
            $view->setContext($context);
        } catch (EntityNotFoundException $e) {
            $view = $this->view($e->toArray(), 404);
        }

        return $this->handleView($view);
    }
public function getAction ( $ id ) { $ contactManager = $ this -> getContactManager ( ) ; $ locale = $ this -> getUser ( ) -> getLocale ( ) ; try { $ view = $ this -> responseGetById ( $ id , function ( $ id ) use ( $ contactManager , $ locale ) { return $ contactManager -> getById ( $ id , $ locale ) ; } ) ; $ context = new Context ( ) ; $ context -> setGroups ( static :: $ contactSerializationGroups ) ; $ view -> setContext ( $ context ) ; } catch ( EntityNotFoundException $ e ) { $ view = $ this -> view ( $ e -> toArray ( ) , 404 ) ; } return $ this -> handleView ( $ view ) ; }
Shows the contact with the given Id.

@param $id

@return \Symfony\Component\HttpFoundation\Response
Shows the contact with the given Id .