You get a bonus - 1 coin for daily activity. Now you have 1 coin

How to relate entities in Doctrine, the equivalent of an SQL JOIN

Practice




how do you link entities in doctrine, the equivalent of SQL JOIN?

in sql, to get data from a joined table together with the main one you can do a JOIN like this

select * from product PR join category C on c.catid=PR.catid


instead of this, in DOCTRINE you need to link two entities so that later you can just make a simple method call

$product->getCat()->getCatName()

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Databases - MySql (Maria DB)"

Terms: Databases - MySql (Maria DB)