FOSElastica + FosRest + Doctrine + REST Api -


versions

  • symfony 2.8.2
  • foselastica 3.1.8
  • fosrest 1.7.7
  • doctrine 2.5.4

problem

hello, have mysql's tables many relations. build rest api, in html json, them. working in html, doesn't in json. indeed, in json returning array multi dimensional, , doctrine made each request data. maneuver makes many times , fail. solution make sql join return of elasticsearch don't how make that. idea?

the better solution make rest api.

rest api never reterning deep json object, asked object.

for instance 1 entity people containing list of cars.

you have make routing :

returning users light object (only id ans important informations) : /users

returning 1 full user without cars : /users/{userid}

returning full list if cars (as light objects) : /users/{userid}/cars

returning full car object (without sub object obviously) : /users/{userid}/cars/{carid}

after can manage routing want restfull


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -