-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[ObjectMapper] Add component #20347
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
base: 7.3
Are you sure you want to change the base?
[ObjectMapper] Add component #20347
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Antoine, thanks for contributing the docs for this new component.
I left some minor comments.
object-mapper.rst
Outdated
#[Map(target: C::class, if: [Source::class, 'shouldMapToC'])] | ||
class Source | ||
{ | ||
public static function shouldMapToB(mixed $value, object $object): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which are the mixed $value, object $object
arguments passed to this method?
object-mapper.rst
Outdated
use Symfony\Component\ObjectMapper\Attributes\Map; | ||
|
||
class Source { | ||
#[Map(target: 'fullName', transform: TransformNameCallable::class)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I use a transform
for the entire object instead of for each of its properties?
CI should be green after a rebase on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A rebase on 7.3 branch would be helpful @soyuka, thanks
I've rebased, this also documents symfony/symfony#60028 as it's quite mandatory for many real world use cases. Interfaces are now matching the merged code. At the beginning I've used real word examples @94noni could you let me know your thoughts and if you think I should apply the same logic accross the whole documentation? |
de11d09
to
f4c8610
Compare
The new version needs symfony/symfony#60028 |
Documents the object mapper component from