nextras / orm

Orm with clean object design, smart relationship loading and powerful collections.
https://nextras.org/orm
MIT License
309 stars 59 forks source link

AnnotationParser: one primary modifier #108

Closed hrach closed 9 years ago

hrach commented 9 years ago

There is, probably, a bug when entity has primary modifier redefined with it's primary key. This will include a bigger refactoring, probably with a BC break, each entity will have to define it's primary property and Nextras\Orm\Entity\Enity will not have a predefined primary key. Will solve #75.

f3l1x commented 9 years ago

It's also for case when table has a composite key for example.

category (id) category_has_tag (category_id, tag_id, extra_column) tag (id)

Right?

hrach commented 9 years ago

@f3l1x no.

f3l1x commented 9 years ago

Could you please help me with this relationships? It is m:n, but how to define it?

hrach commented 9 years ago

Just define the middle entity. And composite PK. See TagFollower in tests.

f3l1x commented 9 years ago

@hrach Thank you.