Bug #56107
Property mapping configuration only supports one wildcard at a time
Status: | New | Start date: | 2014-02-19 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | Property | |||
Target version: | - | |||
PHP Version: | Complexity: | |||
Has patch: | No | Affected Flow version: | Git master |
Description
The PropertyMapper supports wildcards (introduced with #37436) in the form:
1$propertyMappingConfiguration->forProperty('items.*')->allowAllProperties();
Unfortunately this only works for one placeholder at a time. The following will never apply:
1$propertyMappingConfiguration->forProperty('items.*.addons.*')->allowAllProperties();
The only work-around I can think of is:
1$someArgument = $this->request->getArgument('object'); 2$numberOfItems = isset($someArgument['items']) ? count($someArgument['items']) : 0; 3for ($itemIndex = 0; $itemIndex < $numberOfItems; $itemIndex ++) { 4 $propertyMappingConfiguration->forProperty('items.' . $itemIndex . '.addons.*')->allowAllProperties(); 5}
Related issues