Skip to content


DBAL-319: Doctrine\DBAL\Types\Type #1503

doctrinebot opened this Issue · 3 comments

2 participants


Jira issue originally created by user till:

The API could be improved in the next major release:

  • Type::add() instead of addType()
  • Type::isRegistered() instead of hasType() (has sounds weird)

Etc.. I think the 'type' in the methods is redundant since Type is already the object I am dealing with.

I'd also like a remove() method to unregister a type at runtime. Would make testing a little easier and I don't have to check with hasType() etc..


Comment created by @ocramius:

I don't think those namings are really important.
There's one major change to do, which is to somehow get rid of the staticness of the Doctrine\DBAL\Types\Type class, and it is not a simple task.
It would also be interesting to set the type objects manually, such as a database password type that does encryption/decryption based on a given service. That cannot be done without staticness right now, which renders two different connections requiring the same functionality but with different parameters very difficult.


Comment created by till:

I agree on the static. But I'd also like the API to be cleaned up and the remove method.


Comment created by @deeky666:

API cleanup and staticness can be addressed in 3.0 for the first time. Otherwise we cannot keep BC. You can use Doctrine\DBAL\Types\Type::overrideType('someType', null); as a workaround for removing a type from the registry.

@beberlei beberlei was assigned by doctrinebot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.