We don't focus too much on how to create relationships in this tutorial because this tutorial is about a different topic, specifically, how to work with Doctrine queries. So here we're mostly working on an existent DB structure. You can spy on how the relationship is created in the entity mapping, but if you want to learn more on how to create it - take a look at e.g.: https://symfonycasts.com/screencast/symfony3-doctrine-relations/many-to-one-relation - or try our advanced search to find more related content. For example, we talk a lot about Doctrine and its relationships in our latest Symfony Doctrine course: https://symfonycasts.com/screencast/symfony-doctrine
Cheers!
Please, log in to vote for this comment
3|
Share Comment
"Houston: no signs of life" Start the conversation!
2 Comments
But how can I create a one-to-many relationship in the first place?
Hey Daniyal,
We don't focus too much on how to create relationships in this tutorial because this tutorial is about a different topic, specifically, how to work with Doctrine queries. So here we're mostly working on an existent DB structure. You can spy on how the relationship is created in the entity mapping, but if you want to learn more on how to create it - take a look at e.g.: https://symfonycasts.com/screencast/symfony3-doctrine-relations/many-to-one-relation - or try our advanced search to find more related content. For example, we talk a lot about Doctrine and its relationships in our latest Symfony Doctrine course: https://symfonycasts.com/screencast/symfony-doctrine
Cheers!
"Houston: no signs of life"
Start the conversation!