[TYPO3-mvc] General question about relations in extbase

"Søren Andersen" hacksaw at zpeed.dk
Fri Mar 8 08:31:24 CET 2013


I'll answer the question myself with a link to the english translation of
the Extbase Fluid Book:
http://docs.typo3.org/typo3cms/ExtbaseFluidBook/5-Domain/2-implementing-the-domain-model.html

Under the heading: Adding business logic to the domain objects, there's
actually a note discussing exactly my question.

Specifically for my question, I need to place the relation on the Employee
so all registrations are stored with the employee object. However the way
this is accomplished in the background of Extbase is to make a UID
relation on the registration table, exactly as I would do in pibase.

This way I can modify the TCA of the extension builder, to show me the
employee of a registration in the backend. Further in the model of the
registration I can access the UID of the employee, so that I can retrieve
it via the EmployeeRepository after an injection of that repository.

Sincerely,
Søren Andersen

> Hello
>
> This is a newbie question, but I simply can't find any helpful material on
> Google (I'm probably using the wrong search terms).
>
> I'm new to the MVC concept, have been coding procedural style for way too
> long.
>
> I have used "Extension Builder" to build a complex model of an extension I
> want to make. It's an extension for FE users to login and make
> registrations of certain things.
>
> So I a model object of employees with a 1:1 relation to the class:
> TYPO3\CMS\Extbase\Domain\Model\FrontendUser (This works, although I felt
> it necessary to change the TCA, so it didn't use inline, but select.)
>
> Next comes a model object of registrations the employee has made.
>
> Where should I put the relation and why?
> If I place the relation in the employee object, how do I retrieve the
> employee of a specific registration?
> The registration will be "attached" to the employee and in the backend I
> will be able to see all the registrations made by an employee. But I will
> not be able to see the employee on the registration itself.
>
> Yet, if I place the relation on the registration (which is what I would
> normally do in a pibase extension), how do I retrieve all the
> registrations made by an employee?
>
> Can someone point me to some material I can read to get a better
> understanding of this?
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>



More information about the TYPO3-project-typo3v4mvc mailing list