[TYPO3-mvc] Extbase mapping and validation

Joachim Mathes mathes at punkt.de
Tue Aug 9 11:57:56 CEST 2011


Hi there,

I've got two questions concerning the mapping and validation concepts of
Extbase:

1) Is it possible to validate an aggregate root recursively with respect
to their domain validators?
Think of a blog with one aggregated post (no ObjectStorage). With Fluid
it's easy to display, submit and persist the respective properties
eventually:
{blog.title}
{blog.post.title}
{blog.post.text}
...

But as far as I can see, Extbase only validates the "blog" domain
object. It doesn't take into account the property validators of the
aggregated "post". Can you confirm this behaviour?
Anyway, it would be nice, if an aggregate root could be validated
recursively.

2) Is it possible to submit and map the fields of an aggregated
ObjectStorage?
Think of a blog with n aggregated posts. The posts shall be displayed
(editable) next to their blog in one template like this:
{blog.title}
<f:for each="{blog.posts}" as="post">
{post.title}
{post.text}
</f:for>
How can the modified posts be submitted and mapped to an ObjectStorage
of type "Post" and the ObjectStorage be attached to its root "Blog"
eventually? Does Extbase support this in any way?
Jochen Rau shows a trick in the extension sjr_offers for the
"AttendanceFee"s of an "Offer". In
Resources/Private/Templates/Offer/edit.html he creates an array of
attendance fees like this:
attendanceFees[amount][]
attendanceFees[comment][]
This array has to be flipped after transferring it to the controller
action:
attendanceFees[0][amount]
attendanceFees[0][comment]
attendanceFees[1][amount]
attendanceFees[1][comment]
And furthermore all validation has to be done by hand. So this works
quite well for simple domain objects. But it produces quite an overhead
for more complex ones.

Thanks in advance
Joachim



More information about the TYPO3-project-typo3v4mvc mailing list