[TYPO3-mvc] createAction form containing not not all mandatory domain model properties

Jan Kornblum jan.kornblum at gmx.de
Fri Feb 22 09:22:27 CET 2013


Good morning group,

a newAction/createActions form doesn't contain all mandatory domain 
model properties because some properties should be set ba code / 
manually. For example, there is as domain model "Ticket" which owns a 
property "referenceNumber" (@validate notEmpty, @var integer). Calling 
a createAction($newTicket) would fail because the property 
"referenceNumber" is not beeing passed by the previous form / 
newAction.

What is the best practise to handle such models on a form-based 
creation?

I could add a hidden field "referenceNumber" with a dummy value 
(value="1") to the form, and later inside the createAction() i could 
overwrite it using a $newTicker->setReferenceNumber(). This would work 
but would it be nice?

Any better ideas?

Kind regards, Jan




More information about the TYPO3-project-typo3v4mvc mailing list