Hello. I want to get the products as they are at 15:06, but I saw that each product has a "manufacturer" property, which contains a "Manufacturer" object (after the id, name). But if I expand this Manufacturer object, then it contains a complete list of products, because the manufacturer class has the inverse property relation of products products(5:22).... But in the list of products (15:06) I do NOT need a list of all products again loaded in each Manufacturer object (If we expand this object, we will see the products property which is an array of products). This is strange, because it turns out that we get an array of products, and inside each product we again load the full list of products (because it is in each Manufacturer in the product). Can I get a list of all the manufacturer's products without duplicating the products inside the Manufactor object?
@flair034 жыл бұрын
Very well explained and very helpful. Thanks!
@GaryClarkeTech4 жыл бұрын
Thanks Michael...I appreciate it!
@RomskieL2 жыл бұрын
I'm currently trying this out in Symfony 6. The cascade={"persist"} will give me an error, so I tried cascade: ['persist']. It didn't give me an error, but it won't cascade in saving the child. I still need to persist the parent and persist also the child to save them both into the db.
@RomskieL2 жыл бұрын
I got it now. Instead of adding the parent to the child: $child->setParent($parent), I added the child to the parent: $parent->addChild($child). It then cascaded the persist.
@GaryClarkeTech2 жыл бұрын
@@RomskieL Great stuff...I'm glad you managed to figure it out..well done!
@MrWilde3 жыл бұрын
I was under the impression there is no functionality difference between Symfony 5 and 4, just the deprecated items removed in 5. There are some things I saw in this vide not in Symfony 4, liked the mappedBy in the oneToMany relationShip. Is this more of a doctrine version issue? Just an FYI the content is great but it is a ittle hard to follow, jumping between pages very quickly and editing code and the bottom of the page can be hard to see. Just some feedback, but the content is really good.
@GaryClarkeTech3 жыл бұрын
Yes mappedBy..and all the annotations are a Doctrine thing...not directly Symfony related.
@amirkhan-vm7pt23 күн бұрын
is there any github repo for this course?
@GaryClarkeTech7 күн бұрын
No..it was from before I used to maintain accompanying repo's. All my recent courses have repos.
@Hunterrr153 жыл бұрын
Thanks for video, it helped me understand topic :)
@GaryClarkeTech3 жыл бұрын
Great to hear!
@lorandgyorgy-fazakas112 жыл бұрын
Is there a way to setup a relation only by id? (in that case manufacturer_id)
@GaryClarkeTech2 жыл бұрын
It's all fairly configurable. I stick to common conventions as much as I can.
@CaimAstraea3 жыл бұрын
What shortcut did you use for getters and setters in phpstorm ? The shortest path I could find was cmd + N but I still have an extra step while you jumped straight into the window :D
@GaryClarkeTech3 жыл бұрын
Ctrl + enter pulls up the menu Then just select getters and setters...then choose the properties you want to create for