Skip to content

Config-based support for custom repository classes #32

Closed
@stof

Description

@stof

As the PoC of #18 seems stalled to resolve custom repository classes based on the mapping, a simpler solution could be implemented in the meantime (even though it is not as good for DX as it requires more work). Instead of configuring a single repository class used by all entities, we could configure a mapping of entity classes to their repositories (the existing option can of course still be kept for the fallback for entities not present in the map):

parameters:
        doctrine:
                customRepositories:
                        MyApp\Entity\User: MyApp\Doctrine\UserRepository
                        MyApp\Entity\Team: MyApp\Doctrine\TeamRepository
                repositoryClass: MyApp\Doctrine\BetterEntityRepository

What do you think about that solution ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions