cycle / annotated

Schema generation using annotated entities and mappers
MIT License
23 stars 12 forks source link

Possible ManyToMany typo? #23

Closed igbanam closed 2 years ago

igbanam commented 2 years ago

I'm reading through the docs and I see

    /** @ManyToMany(target = "Tag", though = "UserTag") */
    protected $tags;

At first glance, I read this as "entity has many Tag through UserTag" where UserTag is the join class somewhat. Thought to fix that and realized 👇🏾 this is how it's defined.

https://github.com/cycle/annotated/blob/master/src/Annotation/Relation/ManyToMany.php#L59

Could this be a case of a typo carried over because of IDE smarts? If this isn't the case, what's the thought process? I see this commit introduces "though", but the commit message doesn't really say why.

I know this is 2 years old, so it's a long shot; but I had to ask

roxblnfk commented 2 years ago

This typo will be fixed in the next major (or minor but for ORM v2) update https://github.com/cycle/annotated/blob/2.0/src/Annotation/Relation/ManyToMany.php#L87

igbanam commented 2 years ago

Awesome. Thanks.