From 01f2ef028a195eb2ce54e47dfabab513c6df4e3c Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 23 Feb 2012 17:54:10 +0100 Subject: [PATCH] Add Binary MySQL type to doctrine for parsing old Phrasea Tables --- .../Phrasea/Core/Service/Orm/Doctrine.php | 6 +++ lib/Doctrine/Types/Binary.php | 38 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 lib/Doctrine/Types/Binary.php diff --git a/lib/Alchemy/Phrasea/Core/Service/Orm/Doctrine.php b/lib/Alchemy/Phrasea/Core/Service/Orm/Doctrine.php index d04282537b..d40d417105 100644 --- a/lib/Alchemy/Phrasea/Core/Service/Orm/Doctrine.php +++ b/lib/Alchemy/Phrasea/Core/Service/Orm/Doctrine.php @@ -273,10 +273,16 @@ class Doctrine extends ServiceAbstract implements ServiceInterface Type::addType('varbinary', 'Types\VarBinary'); } + if (!Type::hasType('binary')) + { + Type::addType('binary', 'Types\Binary'); + } + $platform->registerDoctrineTypeMapping('enum', 'enum'); $platform->registerDoctrineTypeMapping('blob', 'blob'); $platform->registerDoctrineTypeMapping('longblob', 'longblob'); $platform->registerDoctrineTypeMapping('varbinary', 'varbinary'); + $platform->registerDoctrineTypeMapping('binary', 'binary'); return; } diff --git a/lib/Doctrine/Types/Binary.php b/lib/Doctrine/Types/Binary.php new file mode 100644 index 0000000000..17debee9b4 --- /dev/null +++ b/lib/Doctrine/Types/Binary.php @@ -0,0 +1,38 @@ +getDoctrineTypeMapping('BINARY'); + } + +}