[FLOW3-general] Initialize create action for an unknown number of properties
"Christian Müller (Kitsunet)"
christian.mueller at typo3.org
Wed Sep 28 09:08:17 CEST 2011
This is a known problem and will be solved, for now you can loop and do
the allowCreationForSubProperty up to
$veryHighNumberWhichWontBeReachedByMySubProperties
Cheers,
Christian
On 26/09/11 10:40, Ivan Ruiz Gallego wrote:
> 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