Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jaspernbrouwer opened this issue Mar 20, 2012 · 0 comments
Open

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

jaspernbrouwer opened this issue Mar 20, 2012 · 0 comments

Comments

@jaspernbrouwer
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant