Skip to content

Doctrine\DBAL\Types\Type::overrideType() #30

Open
@jaspernbrouwer

Description

It would be nice to have some config entry for using Doctrine\DBAL\Types\Type::overrideType().

Currently the config entry:
doctrine.dbal.connections.next.types.TYPE = CLASSNAME
will add the type using Doctrine\DBAL\Types\Type::addType().

The small patch below will use overrideType() if the type already exists, and addType() if not.
This eliminates the need for an additional config entry (it is sufficient for me, but I'm not sure others will like it).

435c435,439
<             Type::addType($name, $className);

---
>             if (Type::hasType($name)) {
>                 Type::overrideType($name, $className);
>             } else {
>                 Type::addType($name, $className);
>             }

Thanx!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions