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

Sven Kalbhenn sven at skom.de
Wed May 12 11:30:22 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?

Please, could someone push me in the right direction?

CU...Sven Kalbhenn



More information about the TYPO3-project-typo3v4mvc mailing list