Skip to content

Expose array_map or similar in Expression Language #62753

@cancan101

Description

@cancan101

Description

Expose array_map or something equivalent (such as mapMethod, see below) to allow working with arrays.

function mapMethod(array $items, string $method): array {
    return array_map(fn($item) => $item->$method(), $items);
}

Example

'needle' in mapMethod(myArray, `getMyField`)

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