Feature #37436

PropertyMapper should allow settings like allowCreationForSubProperty('products.[n].tierprices.[n]')

Added by Sebastian Wojtowicz about 9 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Should have
Category:
Property
Start date:
2012-05-23
Due date:
% Done:

100%

Estimated time:
PHP Version:
5.3
Has patch:
Yes
Complexity:

Description

In some projects you might want to allow objects with an unknown amount of sub objects like a catalog with products with images, tierprices and colorconfigurations. Imagine a products form with x rows and a <Add row> button at the bottom that dynamically creates new empty rows with an increased index so you can add as many products as you want. In my case it's even quite a lot more complex.

So... something like this is needed

(I)
$this->arguments['newCatalog']->getPropertyMappingConfiguration()->allowCreationForSubProperty('products.[n]');
$this->arguments['newCatalog']->getPropertyMappingConfiguration()->allowCreationForSubProperty('products.[n].tierprices');
$this->arguments['newCatalog']->getPropertyMappingConfiguration()->allowCreationForSubProperty('products.[n].tierprices.[n]');
$this->arguments['newCatalog']->getPropertyMappingConfiguration()->allowCreationForSubProperty('products.[n].tierprices.[n].price');

instead of

(II)
for($i = 0 ; $i < $very_big_number ; $i++){
for($j = 0 ; $j < $very_big_number ; $j++){
$this->arguments['newCatalog']->getPropertyMappingConfiguration()->allowCreationForSubProperty("products.$i");
$this->arguments['newCatalog']->getPropertyMappingConfiguration()->allowCreationForSubProperty("products.$i.tierprices");
$this->arguments['newCatalog']->getPropertyMappingConfiguration()->allowCreationForSubProperty("products.$i.tierprices.$j");
$this->arguments['newCatalog']->getPropertyMappingConfiguration()->allowCreationForSubProperty("products.$i.tierprices.$j.price");
}
}

and also this should be possible

(III)
$this->arguments['newCatalog']->getPropertyMappingConfiguration()->getConfigurationFor('products')->allowProperties('[n]');
$this->arguments['newCatalog']->getPropertyMappingConfiguration()->getConfigurationFor('products')->getConfigurationFor('[n]')->allowProperties('tierprices');
$this->arguments['newCatalog']->getPropertyMappingConfiguration()->getConfigurationFor('products')->getConfigurationFor('[n]')->getConfigurationFor('tierprices')->allowProperties('[n]');
$this->arguments['newCatalog']->getPropertyMappingConfiguration()->getConfigurationFor('products')->getConfigurationFor('[n]')->getConfigurationFor('tierprices')->getConfigurationFor('[n]')->allowProperties('price');

of course it would be handy to have the allowProperties auto-created by a special renderTrustedPropertiesField() method.
I could imagine a view helper like this

(IV)
<f:trustedUnknownAmount preRenderAmount="3" iterator="n">
<f:trustedUnknownAmount preRenderAmount="2" iterator="m">
<f:form.textfield property="products.{n}.tierprices.{m}.name" />
</f:trustedUnknownAmount>
</f:trustedUnknownAmount>

or at least have a alternative short syntax for (III)


Related issues

Related to TYPO3.Flow - Bug #37292: PropertyMappingConfiguration::mapUnknownProperties is not passed down to SubconfigurationUnder ReviewSebastian Kurfuerst2012-05-18

Actions
Related to TYPO3.Flow - Bug #56107: Property mapping configuration only supports one wildcard at a timeNew2014-02-19

Actions
#1

Updated by Gerrit Code Review about 9 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11547

#2

Updated by Gerrit Code Review about 9 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11591

#3

Updated by Karsten Dambekalns about 9 years ago

  • Target version changed from 1.1 to 1.1 RC1
#4

Updated by Gerrit Code Review about 9 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11594

#5

Updated by Gerrit Code Review about 9 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11547

#6

Updated by Gerrit Code Review about 9 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11547

#7

Updated by Gerrit Code Review about 9 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11547

#8

Updated by Gerrit Code Review about 9 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11547

#9

Updated by Gerrit Code Review about 9 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11547

#10

Updated by Gerrit Code Review about 9 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11547

#11

Updated by Gerrit Code Review about 9 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12166

#12

Updated by Gerrit Code Review about 9 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12166

#13

Updated by Gerrit Code Review about 9 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12166

#14

Updated by Karsten Dambekalns about 9 years ago

  • Assignee set to Christopher Hlubek
#15

Updated by Karsten Dambekalns about 9 years ago

  • Target version changed from 1.1 RC1 to 2.0 beta 1
#16

Updated by Gerrit Code Review almost 9 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12166

#17

Updated by Gerrit Code Review almost 9 years ago

Patch set 1 for branch FLOW3-1.1 has been pushed to the review server.
It is available at http://review.typo3.org/14575

#18

Updated by Karsten Dambekalns over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF