Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ObjectMapper] Support mapping to nested arrays of objects #61116

Open
@crtl

Description

@crtl

Description

Nested mapping is currently only supported for a single object.
Theres currently no way without implementing it yourself using reflection to map array of objects to an array of targets.

Example

// Test source objectclass Book {/**    * @var Page[]    */protectedarray$pages;}// Test dto#[Map(source: Book::class)]class BookDto {/**   * @var PageDto[]   */  #[Map(source:"pages")]publicarray$pages;}// Mapping Book to BookDto$book =newBook();$dto =$mapper->map($book, BookDto::class);var_dump($dto->pages);// Page[]

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp