Reputation: 5129
Object is ArticleVote and it has two related objects: User and Article. This creates user_id and article_id columns in ArticleVote table. Can I go without using "id" as an id of the table and use a composite key that consists of unique combinaiton of user_id and article_id in ArticleVote talble?
Also, is this supported in Doctrine bundled with Symfony2?
Thanks.
Upvotes: 0
Views: 1033
Reputation: 6708
Yes it's support, read: http://www.doctrine-project.org/docs/orm/2.1/en/tutorials/composite-primary-keys.html
Upvotes: 2