[TYPO3-mvc] 1.4 property mapping fails with empty relations?

Tim Schoch | GSTALTIG tim.schoch at gstaltig.ch
Thu Oct 13 08:09:07 CEST 2011


It'sa me again

The before mentioned way does not work fully. It solves the converter check, but fails to assign the value to the domain object itself.
The problem:
When the converter returns NULL, the propertyMapper skipps this property ( Line 176, if ($targetPropertyValue !== NULL) { ... )
If the converter however returns 0 or an empty string, the setter fails because it only allowes instances of the given class or NULL
> public function setOtherDomainModel(Tx_Myext_Domain_Model_Thingie $thingie = NULL) {

I for my part removed the type hint and test for it explicitly. But that can't be the way it's thought to be.
So agian, the question stands, how can a relation be made optional? Does anybody now how/if this is implemented in FLOW3?

You can get the whole code here (I updated the converter too): http://pastebin.com/yD7Vfd89

Tim


More information about the TYPO3-project-typo3v4mvc mailing list