Skip to content

Autoconfigure DBAL types #1867

Open
Open
@GromNaN

Description

@GromNaN

Feature Request

What

When a project implements a Doctrine\DBAL\Types\Type, it's almost certain this needs to be declared in the configuration. Using ContainerBuilder::registerForAutoconfiguration(), it should be possible to automatically detect and register this classes.

Why

Remove some obvious configuration.

types:
custom: Acme\HelloBundle\MyCustomType

How

  • In DoctrineExtension, call $this->registerForAutoconfiguration() to add a tag.
  • Add a compiler pass that find service by tag name and append the classes names to the doctrine.dbal.connection_factory.types parameter.

Types are not scoped to the DBAL connection.

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