Feature #6869

Enable the property mapper to create value objects

Added by Robert Lemke over 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Must have
Category:
Property
Start date:
2010-03-16
Due date:
% Done:

100%

Estimated time:
2.00 h
PHP Version:
Has patch:
Complexity:

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 (diff)
Added by Karsten Dambekalns over 9 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 9 years ago

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

Applied in changeset r3960.

Also available in: Atom PDF