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

Possibility to declare a few count of mappers #18

Open
anuri73 opened this issue Sep 20, 2018 · 0 comments
Open

Possibility to declare a few count of mappers #18

anuri73 opened this issue Sep 20, 2018 · 0 comments

Comments

@anuri73
Copy link

anuri73 commented Sep 20, 2018

public function registerMap(MapInterface $map)
{
$this->maps[$map->getSourceType()][$map->getDestinationType()] = $map;
}

This part of your very useful project give us availability to store only one map between source class and destination class. Is it available to avoid it somehow, to be capable to initialize several maps and choose between them?
I think it would be very convenient to get the mapper with:

$this->mapper->map($sourceClass, $myMapp, $destinationClass);

function map($source, MapInterface $map, ?$destination = null);

Because

  1. As I already said it give us opportunity to choose mapper depend on some condition
  2. No need to store all maps, as we already know what mapper we should use

P.S. Thank you for your wonderful library.

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

1 participant