[FLOW3-general] Initialize create action for an unknown number of properties
Ivan Ruiz Gallego
ivan at loglan.net
Mon Sep 26 10:40:30 CEST 2011
Hi,
I'd like to create an object Foo that has a OnetoMany association to
Bar. I have a single form where the user can decide how many bars might
be associated with foo.
For a known number of associated bars, let's say 4, I can initialize the
create action like this:
$this->arguments['foo']->getPropertyMappingConfiguration()->allowCreationForSubProperty('bars');
$this->arguments['foo']->getPropertyMappingConfiguration()->allowCreationForSubProperty('bars.0');
$this->arguments['foo']->getPropertyMappingConfiguration()->allowCreationForSubProperty('bars.1');
$this->arguments['foo']->getPropertyMappingConfiguration()->allowCreationForSubProperty('bars.2');
$this->arguments['foo']->getPropertyMappingConfiguration()->allowCreationForSubProperty('bars.3');
But if the number of bars is unknown? Is there a way to configure the
property mapper of foo so that any number of bars may be created? I'm
looking for something like:
$this->arguments['foo']->getPropertyMappingConfiguration()->allowCreationForSubProperty('bars');
$this->arguments['foo']->getPropertyMappingConfiguration()->allowCreationForSubProperty('bars.*');
But this is of course not working!
Thanks,
Ivan.
More information about the FLOW3-general
mailing list