Skip to content

Topic Request: Relations with STI #184

@vercotux

Description

@vercotux

Hi Samdark,

I was reading through the cookbook's Single Table Inheritance article and found it very useful, but I noticed it's missing one key part: dealing with relations.

It would be great if you could add an explanation on how to declare relations from a regular AR to a STI AR and vice versa. For example, in the article there is a Car AR. Could we add for example a hypothetical AR called Vendor which has a getCars() (and maybe getSportCars(), getHeavyCars()) relation(s) pointing to Car? And then a hasOne getVendor() relation in Car pointing back to Vendor. Maybe briefly touch on how inverseOf would work in that case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions