[Flow] Property Mapping configuration for Array colleciton of objects
Rocky
rockysynergy at gmail.com
Wed Jul 2 05:30:07 CEST 2014
Hey,
families (which is Array Collection type) is property of Applicant object. It holds many Family objects. The Family object has Age object witch has birthDate ( the type is Datetime) property. According to the manual http://docs.typo3.org/flow/TYPO3FlowDocumentation/TheDefinitiveGuide/PartIII/PropertyMapping.html#configuring-the-conversion-process, I should be able to configure the Datetime format using below code:
$this->arguments["newApplicant"]
->getPropertyMappingConfiguration()
->forProperty('families.*.age.birthDate)
->setTypeConverterOption('TYPO3\Flow\Property\TypeConverter\DateTimeConverter', \TYPO3\Flow\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT, 'Y-m-d');
The TYPO3 Flow says "There is an error calling create action" and show the form again. However as showing below, if I use actual index (instead of *) for "forProperty" argument it works.
$this->arguments["newApplicant"]
->getPropertyMappingConfiguration()
->forProperty('families.1.age.birthDate) <=== Here I use 1
->setTypeConverterOption('TYPO3\Flow\Property\TypeConverter\DateTimeConverter', \TYPO3\Flow\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT, 'Y-m-d');
$this->arguments["newApplicant"]
->getPropertyMappingConfiguration()
->forProperty('families.2.age.birthDate)
->setTypeConverterOption('TYPO3\Flow\Property\TypeConverter\DateTimeConverter', \TYPO3\Flow\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT, 'Y-m-d');
Any idea I can use * to configure the Datetime converter please?
More information about the Flow
mailing list