Skip to content

[ObjectMapper] Allow transform from target #61027

Open
@tems99

Description

@tems99

Description

Right now, the transform attribute only works from the source class. If you define a transform at the class level in the target class, it does not apply.

Use case:
Entities can be mapped to multiple DTO's.
Instead of the entity containing the mapping information, it would be ideal to have the DTO contain the mapping attribute.

Example

#[Map(source: BookingVoyage::class, transform: BookingVoyageApiTransformer::class)]
class BookingVoyageApi
{
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy