Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DCOM-309: Design metadata API to map 0..N properties to 0..M values #623

Open
doctrinebot opened this issue Nov 7, 2015 · 0 comments
Open
Assignees

Comments

@doctrinebot
Copy link

Jira issue originally created by user @Ocramius:

We need a design for an API that allows converting (bi-directional) an arbitrary number of properties to an arbitrary number of values.

A rudimentary approach could be as following:

interface ToValueConverterInterface
{
    // must be inlinable?
    public function **invoke(
        PropertiesMapInterface $properties // these are the properties in an object - not sure if we should pass in the object
    ) : ValuesMapInterface; // may be an array of scalars - not sure
}

interface ToObjectConverterInterface
{
    // must be inlinable?
    public function **invoke(
        ValuesMapInterface $values // may be an array of scalars - not sure
    ) : PropertiesMapInterface; // these are the properties in an object - not sure if we should pass in the object
}

interface PropertiesMappingInterface
{
    public function buildToValuesConverter(MapperContext $mapperCtx) : ToValueConverterInterface;
    public function buildToObjectConverter(MapperContext $) : ToObjectConverterInterface;
}

buildToValuesConverter and buildToObjectConverter must be idempotent, so that we can generate code for each direction of the conversion via DCOM-307 (Code inliner)

@doctrinebot doctrinebot added this to the 3.0 milestone Dec 6, 2015
@alcaeus alcaeus removed this from the next milestone May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants