Commit 2727ad90 authored by Henrik Westphal's avatar Henrik Westphal

Allow NULL value when converting a blob to PHP value.

parent 21a2753b
...@@ -44,7 +44,9 @@ class BlobType extends Type ...@@ -44,7 +44,9 @@ class BlobType extends Type
*/ */
public function convertToPHPValue($value, AbstractPlatform $platform) public function convertToPHPValue($value, AbstractPlatform $platform)
{ {
if (is_string($value)) { if (null === $value) {
return null;
} else if (is_string($value)) {
$value = fopen('data://text/plain;base64,' . base64_encode($value), 'r'); $value = fopen('data://text/plain;base64,' . base64_encode($value), 'r');
} else if ( ! is_resource($value)) { } else if ( ! is_resource($value)) {
throw ConversionException::conversionFailed($value, self::BLOB); throw ConversionException::conversionFailed($value, self::BLOB);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment