[TYPO3-mvc] m:n:1 relations?

Franz Koch typo3.RemoveForMessage at elements-net.de
Mon Sep 1 15:03:38 CEST 2014


Hey,

>> currently working on an extension that models books (yeah, it's a
>> classic ;-)). Each book should have a set of associated persons and each
>> person can have one of a set of predefined roles (author, illustrator...)
>>
>> How can this be modelled using extbase? Any example code out there?
>
> Simply model your model as you just described it using
> EXT:extension_builder:
>
> http://typo3.org/extensions/repository/view/extension_builder

To give a indicator on how the models could be arranged, I'd create 4 
models: Book, Person, Role, Relationship (you might find a better name 
for the later).

Now, a Book would have a "relatedPersons" property connected to 
Relationship models. A Relationship would have n:1 properties for Book, 
Person, Role. That way, the same person could have several roles 
(author, publisher, ...) while still beeing a unique entity.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list