mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Add Binary MySQL type to doctrine for parsing old Phrasea Tables
This commit is contained in:
@@ -273,10 +273,16 @@ class Doctrine extends ServiceAbstract implements ServiceInterface
|
|||||||
Type::addType('varbinary', 'Types\VarBinary');
|
Type::addType('varbinary', 'Types\VarBinary');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Type::hasType('binary'))
|
||||||
|
{
|
||||||
|
Type::addType('binary', 'Types\Binary');
|
||||||
|
}
|
||||||
|
|
||||||
$platform->registerDoctrineTypeMapping('enum', 'enum');
|
$platform->registerDoctrineTypeMapping('enum', 'enum');
|
||||||
$platform->registerDoctrineTypeMapping('blob', 'blob');
|
$platform->registerDoctrineTypeMapping('blob', 'blob');
|
||||||
$platform->registerDoctrineTypeMapping('longblob', 'longblob');
|
$platform->registerDoctrineTypeMapping('longblob', 'longblob');
|
||||||
$platform->registerDoctrineTypeMapping('varbinary', 'varbinary');
|
$platform->registerDoctrineTypeMapping('varbinary', 'varbinary');
|
||||||
|
$platform->registerDoctrineTypeMapping('binary', 'binary');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
38
lib/Doctrine/Types/Binary.php
Normal file
38
lib/Doctrine/Types/Binary.php
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2010 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @package
|
||||||
|
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||||
|
* @link www.phraseanet.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Types;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Types\Type;
|
||||||
|
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||||
|
|
||||||
|
class Binary extends Type
|
||||||
|
{
|
||||||
|
const BINARY = 'binary';
|
||||||
|
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return static::BINARY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
|
||||||
|
{
|
||||||
|
return $platform->getDoctrineTypeMapping('BINARY');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user