[TYPO3-dev] extbase/fluid: validating and manipulating data before saving?

Sven Kalbhenn sven at skom.de
Wed May 12 09:50:37 CEST 2010


Hi guys!

I'm writing a new extension for "plane-reservations" with extbase and fluid.
For the reservation, I need a frontend-form with a date- and time-field.
If I understand everything right, I have to write a new ViewHelper for rendering the form.
OK, but where is the correct place for the validation and transforming the posted values into a DateTime-Object?

If I send the date as a string, I always get the error:
"Tx_Planereservation_Domain_Model_Reservation::setStart() must be an instance of DateTime, string given in .../typo3conf/ext/planereservation/Classes/Domain/Model/Reservation.php"

I think the setter-method of the model is the wrong place - because the persistent-manager will use this method as well.
So, is the controller the correct place??? Or is there a mechanism - like the ViewHelpers - to validate and manipulate the data before saving it?

Can someone explain it to me? Or is there a documentation for such problems?

CU...Sven Kalbhenn






More information about the TYPO3-dev mailing list