Controller/GeolocationController.php
public function listAction(Request $request)
    {
        $objects = $this->get('doctrine.orm.default_entity_manager')->getRepository($request->get('class'))->findAll();
        // Fix for FOSRestBundle use
        if ($this->container->has('jms_serializer')) {
            return new Response($this->get('jms_serializer')->serialize($objects, 'json', SerializationContext::create()->setGroups(array('Default'))));
        }

        return new JsonResponse($objects);
    }
public function listAction(Request $request)
    {
        $objects = $this->get('doctrine.orm.default_entity_manager')->getRepository($request->get('class'))->findAll();
        // Fix for FOSRestBundle use
        if ($this->container->has('jms_serializer')) {
            return new Response($this->get('jms_serializer')->serialize($objects, 'json', SerializationContext::create()->setGroups(array('Default'))));
        }

        return new JsonResponse($objects);
    }
public function listAction ( Request $ request ) { $ objects = $ this -> get ( 'doctrine.orm.default_entity_manager' ) -> getRepository ( $ request -> get ( 'class' ) ) -> findAll ( ) ; // Fix for FOSRestBundle use if ( $ this -> container -> has ( 'jms_serializer' ) ) { return new Response ( $ this -> get ( 'jms_serializer' ) -> serialize ( $ objects , 'json' , SerializationContext :: create ( ) -> setGroups ( array ( 'Default' ) ) ) ) ; } return new JsonResponse ( $ objects ) ; }
List objects for geolocation

@author Vincent Chalamon <vincentchalamon@gmail.com>

@param Request $request

@return JsonResponse
@throws \InvalidArgumentException
List objects for geolocation