mark-gerarts / mark-gerarts/automapper-plus

Registering mapping for child properties

Open
#36 5 comments 0 reactions 0 assignees View on GitHub
enhancement question
Dominant language
PHP
Stars
562
Forks
32
PR merge metrics
No merged PRs in 30d

Description

I'm currently trying to use the automapper to solve this problem:

I have multiple objects to map, and I have multiple `\DateTime` properties in those; I would like to map all of those to the same format\DTO. I have set up everything correctly, but every time that a source object has a `\DateTime` property, I'm forced to call `->forMember('field', Operation::mapTo(DateTimeDto))`.

Is there any way to map that just once and for all?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the mapping configuration represented by forMember and Operation::mapTo(DateTimeDto), focusing on how repeated DateTime properties are currently registered. Determine the intended project-wide behavior and define what would demonstrate that multiple source objects map their DateTime properties without separate per-field configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.