Closed maxbrokman closed 8 years ago
Looks good. Let me check it this afternoon and I'll merge it :-)
Great, thanks buddy!
I've just tagged version 1.0.2. Thank you for your contribution!
You're welcome! Thanks for accepting!
Doctrine will keep complaining about a database out-of-sync with the mapping files until we add SQL comments. Please add this to PhpEnumType.php:
/**
* @param AbstractPlatform $platform
* @return boolean
*/
public function requiresSQLCommentHint(AbstractPlatform $platform)
{
return true;
}
I'm not sure if it is a good idea to merge this specific use cases.
I probably shouldn't have merge this one in the first place, without testing it with all supported database systems. However, it looked pretty logic.
So, from now on, I'm going to promote extending the base PhpEnumType
class instead, in order to provide custom behavior.
In your case, just do this:
class MyPhpEnumType extends PhpEnumType
{
/**
* @param AbstractPlatform $platform
* @return boolean
*/
public function requiresSQLCommentHint(AbstractPlatform $platform)
{
return true;
}
}
And remember to register enums with your own enum type.
Some platforms supported by doctrine don't support comments (e.g sqlite, which I'm trying to use for integration tests). Looking into the primary doctrine column definitions it doesn't seem like doctrine uses comments anywhere.
Seeing as the comment doesn't seem to have any programmtic use I've removed it.