[Flow] Property Mapping configuration for Array colleciton of objects

Helmut Hummel helmut.hummel at typo3.org
Wed Jul 2 23:28:26 CEST 2014


Hi!

On 02.07.14 14:40, Bastian Waidelich wrote:

> IIRC the placeholder syntax (*) is only supported for allowed
> properties,

Not quite true. It is, in theory, also supported for configuration, 
*but* if you render a form field in fluid it will generate a property 
mapping configuration for that property using a concrete index:

<f:textfield property="families.0.age.birthDate" />

Will create a property configuration for families.0 to allow creating a 
family object and to allow the properties of the family object.

Now when you use

->forProperty('families.*')

in your controller, this configuration is added, but when fetching the 
configuration for 'families.0' again, the auto-generated configuration 
from Fluid will take precedence and everything set for 'families.*' is 
ignored[1].

> you can't set TypeConverterOptions recursively

Recursively setting TypeConverterOptions *never* works for the reasons 
described above.

> but have to
> use the index: https://gist.github.com/bwaidelich/880a69cf9ceef75c9b38

This is indeed the only solution currently if you use Fluid for templating.

Kind regards,
Helmut

[1]https://github.com/robertlemke/TYPO3.Flow/blob/master/Classes/TYPO3/Flow/Property/PropertyMappingConfiguration.php#L221

-- 
Helmut Hummel
Release Manager TYPO3 6.0
TYPO3 Core Developer, TYPO3 Security Team Member

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the Flow mailing list