Feature #6869

Enable the property mapper to create value objects

Added by Robert Lemke over 5 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2010-03-16
Priority:Must have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Property
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 8 Estimated time:2.00 hours
PHP Version: Complexity:
Has patch:

Description

Immutable value objects don't have any setter methods. However we want the property mapper to be able creating such objects (e.g. after a form has been submitted). Therefore the transformToObject method needs to be aware of this situation.

If no setter methods could be found (well, if ObjectAccess doesn't allow setting the property), the mapper should check if a constructor parameter of that name exists. The challenge however is that properties cannot be set individually during the for loop but must be collected and then set while creating the object.

Associated revisions

Revision f1d7ed1e
Added by Karsten Dambekalns over 5 years ago

[~TASK] FLOW3 (Persistence): Fixed Jochen's favorite FLOW3 code snippet, see http://twitter.com/jocrau/statuses/10537988072
[+FEATURE] FLOW3 (Property): When creating object the PropertyMapper now makes use of constructor arguments, this enables value object creation and thus resolves #6869.

History

#1 Updated by Karsten Dambekalns over 5 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r3960.

Also available in: Atom PDF