In the part 1 of the Doctrine Tutorial we did some seriously cool stuff done with Doctrine (we've earned 🍦 imo). We created entity classes (thanks make:entity!), made custom queries, migrations, set up Docker & more!
But... we ignored one of the biggest part of Doctrine: relations / associations! Thankfully, creating database relationships - ManyToOne, ManyToMany, etc - has never been easier and Doctrine handles a ton of the work for us.
Lift off in T minus... just start already! 🚀
- Generating the famous ManyToOne relationship (association)
- Setting relationship (forget the foreign keys, it's all about the objects!
- Handling relationships in fixtures with Foundry
- The OneToMany "inverse" side of a relation
- Filtering a collection of related objects with Criteria
- orphanRemoval (not as heartless as it sounds!)
- Querying with Joins
- Solving the N+1 problem
- ManyToMany Relations
- ManyToMany with extra data on the join table
Your mission: tackle Doctrine relationships... without crashing the ship. You got this!