[FLOW3-general] Mapping and adding objects - problem with properties

Ferdinand Kuhl fcool at coolys.de
Wed Aug 31 01:59:12 CEST 2011


Hi Dawid,

for your problem with Datetime search the newsgroup. Mathis had the same 
problem.

Search for "DateTime and FLUID-Form".

Greetings,
Ferdinand

Dawid Pacholczyk wrote:

> Hello List,
>   I have problem with mapping or maybe with adding nested models and
> DateTime
> 
> 1. I have user model that is associated with address model. Address has
> 3 fields that are not properties of user. How can I create *one* form
> where I can add properties of user and address with out exception ? How
> should I fetch data ?
> 
> 2. I can convert string to DateTime object. I have
> 
> /**
> * Users birthdate
> *
> * @var \DateTime
> * @Column(type="date")
> */
> protected $birthdate;
> 
> <f:form.textbox property="birthdate" id="birthdate" />
> 
> /**
> * Initialize createAction
> *
> * @return void
> */
> public function initializeCreateAction() {
> 
> $this->arguments['newUser']->getPropertyMappingConfiguration()-
>forProperty('birthdate')-
>setTypeConverterOption('TYPO3\FLOW3\Property\TypeConverter\DateTimeConverter',
>  
> 
\TYPO3\FLOW3\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT,
> 'd.m.Y');
> }
> 
> 
> But I keep getting exception
> 
> #1297759968: Exception while property mapping at property path
> "birthdate":The string"10-05-2011" could not be converted to DateTime
> with format "d.m.Y"
> 
> What am I doing wrong ?
> 
> Best regards,
> Dawid Pacholczyk



More information about the FLOW3-general mailing list