Skip to content

Bad practice in the form data transformer cookbook #2471

Closed
@stof

Description

@stof

The data transformer cookbook is configuring the entity maanegr by passing it through an option. This is a bad practice. Dependencies should be injected in the type through the constructor. Otherwise, all parent fields would need to know the EM too to pass it.

To allow switching between managers, the clean way is to allow passing its name (which is a string, not an object) and getting it from the registry. See the DoctrineType for instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FormactionableClear and specific issues ready for anyone to take them.hasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions