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

Added syntactic sugar for extending mappings #79

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

denisvanmorgan
Copy link

Hi, I was working recently with this package which I really like and kept struggling in situation where I need to define just one property of mapped class. I'm using unregistered mappings in project so I thought that I'm gonna define mapping just for that one property and keep the rest as they were mapped by "unregistered mapping". So I did that and realised I need to define mapping for each property when registering mapping (which in this case is very verbose) because unregistered mappings are registered on fly. But then I realised that I can get that already unregistered mapping by getMappingFor method and then register mapping for my class and copy that unregistered mapping to it and then finally define mapping for my property where I need to define it's unique format. This way I achieved that all properties are mapped and I'm overriding already mapped properties. This took me some time because it was not really obvious for the first time from code.

So I thought it would be nice to have it in form of syntactic sugar as a method. As you see I prepared this PR based on my experience and it's fully backward compatible without any issues because it uses well known methods of this projects.

Thank you for response

@mark-gerarts
Copy link
Owner

Thank you for the PR! I've read to the code and it's looking good, nice of you to include docs + tests as well. I'm going to play around around with this in the following days/weeks to make sure I really understand what's going on, and then I'll be merging this.

@denisvanmorgan
Copy link
Author

Sure, no problem. Feel free to ping me in any case

@fd6130
Copy link

fd6130 commented Mar 15, 2022

Any good news for this PR?

@maurei
Copy link

maurei commented Dec 20, 2023

Hello @mark-gerarts,

I'm considering introducing your php AutoMapper to our codebase at my employer. Trying to get a sense of the stability of this library. I noticed PR has been idle for a long term and the maintainer hasn't responded anymore.

I was hoping you could help me with understanding where this library is at?

Cheers

@mark-gerarts
Copy link
Owner

mark-gerarts commented Apr 13, 2024

Hello @maurei, thank you for your interest. The current version of the library is being maintained, but at a very slow pace. This is due to two main reasons:

  • Lack of time on my part (combination of uni & work)
  • I no longer work at a PHP shop

Concretely, this means that I focus on bugfixes, answering questions, and bumping dependencies (e.g. Symfony support of the bundle). Given enough interest I pick up bigger things, but only when I have the time and motivation to do so.

If you want a more up-to-date mapper, I suggest looking into https://github.com/jolicode/automapper. It emerged around the same time as this library (under Jane back then), and is being actively extended with new features (e.g. attributes). Documentation for the 8.x version is a bit sparse, take a look at the latest version instead. It is a mature implementation - at one point it was suggested as a Symfony component (discussion here).

On that note, also look into this RFC for more discussion on getting an object mapper into Symfony (it also continues the discussion on JoliCode's mapper).

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

Successfully merging this pull request may close these issues.

None yet

4 participants