In the part 1 of the Doctrine Tutorial we got a sweet setup with Doctrine: entities, queries, migrations and fixtures.
But, we left out one big piece: database relations. Once you've mastered these, you'll be unstoppable. Unfortunately, a lot of information out there make Doctrine relations look over-complicated. Actually, they're simple and beautiful. Sure, they have some pitfalls - but they'll also help you build a complex data structure in no time.
ManyToOne relationships (associations)
The OneToMany side of a relation
The downfall of owning versus inverse sides of a relation
Doing magic with the ArrayCollection
Querying with Joins
... and more - like some magic with the "Param Conversion".
Overview
Syllabus
- 01. Create Genus Note
- 02. The King of Relations: ManyToOne
- 03. Saving a Relationship
- 04. JoinColumn & Relations in Fixtures
- 05. Controller Magic: Param Conversion
- 06. OneToMany: Inverse Side of the Relation
- 07. Order By with a OneToMany
- 08. Tricks with ArrayCollection
- 09. Querying on a Relationship
- 10. Query across a JOIN (and Love it)
Taught by
Ryan Weaver