On Saturday, 15 February 2014 18:24:02 UTC+1, Parsifal wrote: > > If I remember correctly once you had told me that you are using plural > names for relationships? Didn't you? And this invoiced should be singular? > For what do you use plural? > No, I have never said that. You must have misunderstood. You should only use a plural name for a collection and use a singular name for a single thing. And in a ManyToOne/OneToMany relationship there is always a collection on one side (for instance: $invoiceItems or $comments) and a single thing on the other side (for instance $invoice or $writtenBy). In such a relation the ManyToOne side,* the 'owning' side* (in ORM-jargon), *is always singular*; it holds the 'foreign key' (in relational database jargon). See: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html#adding-bug-and-user-entities
The only exception to using *plural names at the* *inverse side* of a OneToMany relationship is when you can use an appropriate singular word to describe a collection (like "backlog" or "cookiejar"). You must be able to use the name of a property in an english sentence that makes sense. -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/groups/opt_out.
