0
本当に奇妙なことが起こっています。次のコードは、Slim 3とDoctrine 2を使用してWebサービスでリクエストしたものです。空のレスポンスを指定しています。配列がいっぱいになっていますが、空に戻ります!空のレスポンスWebサービスDoctrine 2 Slim 3
$data = $request->getParsedBody();
$intervention_items = $this->em->getRepository('App\Entity\V_Interventionitems')
->findAll(array('ic_interventiontype_id' => $data['it_id']));
foreach ($intervention_items as $int_items){
$data_response[] = $int_items->toArray();
//echo json_encode($int_items->toArray()); here prints the info right
}
return $response->withStatus(200)
->withHeader('Content-Type', 'application/json')
->write(json_encode($data_response)); //here returns empty
私はこの問題は非常に素人である知っているが、私は私を助けるために私の友人のKnoledgeを呼び出しています;)
var_dump($ data_response)は何を出力しますか? –