In Symfony 2 I generate a Bundle for storing any type of document into database, but I need the BLOB column type.
Tnx to this question I add the class BlobType into Doctrine DBAL, but for use the new column type I had to change
Doctrine\DBAL\Types\Type
[...]
const BLOB = 'blob';
[...]
private static $_typesMap = array(
[...],
self::BLOB => 'Doctrine\DBAL\Types\BlobType',
);
Doctrine\DBAL\Platforms\MySqlPlatform (maybe it was better if I had changed Doctrine\DBAL\Platforms\AbstractPlatform)
[...]
protected function initializeDoctrineTypeMappings()
{
$this->doctrineTypeMapping = array(
[...],
'blob' => 'blob',
);
}
[...]
/**
* Obtain DBMS specific SQL to be used to create time fields in statements
* like CREATE TABLE.
*
* @param array $fieldDeclaration
* @return string
*/
public function getBlobTypeDeclarationSQL(array $fieldDeclaration)
{
return 'BLOB';
}
Now I don't have mouch time for a 'pretty solution', but in future I would like to restore the Doctrine classes and be able to assign the new column type into Symfony 2 bootstrap. I think I should edit my app/bootstrap.php.cache but I don't have idea how to intervene.