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)
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:
buildToValuesConverterandbuildToObjectConvertermust be idempotent, so that we can generate code for each direction of the conversion via DCOM-307 (Code inliner)