Skip to content

Allow value objects in fromArray #13

@codeliner

Description

@codeliner

With a small change it would be possible to support value objects in fromArray factory method.

This line in ImmutableRecordLogic needs to be changed to:

$recordData[$key] = $this->fromType($this->voTypeToNative($val, $key, $type), $type);

  • Check if it works like expected
  • Add unit tests for it
  • Add doc block comments to fromArray and fromRecordData to explain difference *

*) Difference: fromRecordData avoids mapping values to native data and back to VO. So it is more performant. On the other hand, fromArray can be used as a universal factory, which makes handling much simpler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions