common icon indicating copy to clipboard operation
common copied to clipboard

DCOM-308: Create a Mapping Component

Open doctrinebot opened this issue 10 years ago • 1 comments

Jira issue originally created by user @ocramius:

All of the ORM/ODM projects currently rely on bi-directional mapping of:

  • one column (persistence layer) <-> one object property
  • one column (persistence layer) <-> one embeddable property
  • multiple columns (persistence layer) <-> one embeddable property
  • multiple columns (persistence layer) <-> one object property
  • one column (persistence layer) <-> multiple property
  • one column (persistence layer) <-> multiple embeddable properties
  • one column (persistence layer) <-> an association
  • multiple columns (persistence layer) <-> an association ... and more

Hibernate ORM seems to abstract this logic with a Property and a Column abstractions, each being a visitable DSL ( accept($value, $orm) , or similar).

This sort of DSL would be:

  • a good replacement for DBAL types
  • a good embeddable hacks
  • a good replacement for association hydration logic
  • a good replacement for identifier mapping

We could need a mapping component that allows mapping any map-alike data-structure to any php object graph.

doctrinebot avatar Nov 07 '15 16:11 doctrinebot