0
Я пытаюсь создать API для своего приложения, и я хочу включить 3 таблицы в один get.Как сделать многоуровневый API Doctrine
Это, как я получаю сейчас
{
id: 1,
tocht_id: 1,
user_id: 1,
started_bool: true,
finished_bool: false
},
Я хочу, чтобы получить данные, как этот
{
id: 1,
tocht {
id: 1
naam: intro tocht
opleiding: testOpleiding
informatie: testInfo }
user {
id: 1
naam: vincent
pin: 666 }
started_bool: true,
finished_bool: false
},
Это мой код, чтобы получить данные
public function getAction()
{
$restresult = $this->getDoctrine()->getRepository('AppBundle:Koppel_tocht_user')->findAll();
if ($restresult === null)
{
return new View("there are no records to display.", Response::HTTP_NOT_FOUND);
}
return $restresult;
}
Есть ли простой способ сделать это в учении?