[FLOW3-general] Own TypeConverter
Manfred Rutschmann - VOLUMEN Werbe-/Internetagentur
rutschmann at agentur-volumen.de
Wed Mar 6 10:32:23 CET 2013
Hi list,
one question about type converter:
In my model i have a field named estimatedtime, stored with seconds in the database. In the frontend the user can make this input:
1h 30min
I have written a own simple typeconverter like this:
http://pastebin.com/qcAbepTA
I used this converter in my initializeUpdateAction:
/**
* initializeCreateAction
* @return void
*/
public function initializeUpdateAction() {
$this->arguments["aufgabe"]
->getPropertyMappingConfiguration()
->forProperty('faellig')
->setTypeConverterOption('TYPO3\FLOW3\Property\TypeConverter\DateTimeConverter', \TYPO3\FLOW3\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT, 'd.m.Y H:i');
$this->arguments["aufgabe"]
->getPropertyMappingConfiguration()
->forProperty('estimatedtime')
->setTypeConverterOption('Kunden\Property\TypeConverter\HourMinuteToSecondsConverter', 'integer', NULL);
$this->arguments['aufgabe']->getPropertyMappingConfiguration()->allowProperties('company');
$this->arguments['aufgabe']->getPropertyMappingConfiguration()->allowProperties('projekt');
}
I have set the converter here only for the property estimatedtime, but flow applies this Converter to ALL defined integers in my model.
Because of this i get by every property on the form that is defined as integer a error like "No hour or Minute give"
Why? I have no idea...
Thanks & regards Manfred
More information about the FLOW3-general
mailing list