[TYPO3-mvc] different validations for same model used twice in a single form

Jochen Rau jochen.rau at typo3.org
Thu Mar 29 19:22:11 CEST 2012


Hi Tim,

> How can i make the Company->Address fields required and the
> BillingAddress->Address fields optional? Both Company and BillingAddress
> obviously use the same Address Model (to avoid duplicate code) and i can
> only set one annotation per property.

So, you have two distinct properties in your Company class: one
referencing the address and one referencing the billingAddress? A custom
BillingAddressValidator attached to the billingAddress might help.

-Jochen


More information about the TYPO3-project-typo3v4mvc mailing list