[FLOW3-general] Mapping and adding objects - problem with properties
Dawid Pacholczyk
dpacholczyk at gmail.com
Wed Aug 31 08:04:32 CEST 2011
1) No, I did not forget about setter. I have both, setter and getter for
this field. Setter is set as public
2) I`ve found 2 days ago. I used the same example. I`ve changed only
fields name.
That`s why I`m looking for help
Best regards,
Dawid Pacholczyk
W dniu 2011-08-31 01:59, Ferdinand Kuhl pisze:
> 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