Hi all
I have a serious problem which I do not know how to solve. I do an SQL query and check the output with var_dump($personenAddress[0]) which gives me the following answer back:
array(1) { [0]=> object(JPP\ProfileBundle\Entity\ProfileAddress)#389 (8) { ["id":"JPP\ProfileBundle\Entity\ProfileAddress":private]=> int(1) ["userId":"JPP\ProfileBundle\Entity\ProfileAddress":private]=> int(1) ["street":"JPP\ProfileBundle\Entity\ProfileAddress":private]=> string(16) "Röswerrstrasse 17" ["plz":"JPP\ProfileBundle\Entity\ProfileAddress":private]=> string(4) "44422" ["place":"JPP\ProfileBundle\Entity\ProfileAddress":private]=> string(8) "Lostorf2" ["phone":"JPP\ProfileBundle\Entity\ProfileAddress":private]=> string(10) "462556589578" ["mobile":"JPP\ProfileBundle\Entity\ProfileAddress":private]=> string(10) "174592616719" ["email":"JPP\ProfileBundle\Entity\ProfileAddress":private]=> string(21) "raor.boeren@gmx.net" }
One line below I want to give back the JQuery answer:
$response = new Response(json_encode(array("PersonenAdresse"=>$personenAddress,"SuchResultatEndeId"=>$endResultArray,"Test"=>"Rüdiger")));
$response->headers->set('Content-Type', 'application/json');
return $response;
As you can see there are several parameters which are given back:
1. PersonenAdresse: This one is empty, instead of the Address which must be inside!
2.
SuchResultatEndeId: gives back a 1, which is correct
3. Test: gives back Rüdiger which is also correct.
Here is the output from firebug:
{"PersonenAdresse":[[{}]],"SuchResultatEndeId":[[{"userId":1}]],"Test":"Rüdiger"}
But what is not working? Please can you help me? Thank you very much!
Cheers Roger