From 49ae517e9b0a24c51b6ffe0542b10c79d38232f9 Mon Sep 17 00:00:00 2001 From: Pavel Merzlyakov Date: Tue, 4 Jul 2023 13:57:39 +0300 Subject: [PATCH] support default null value for blob type --- src/codegen.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/codegen.inc.php b/src/codegen.inc.php index 8e5a2cb..bb2a0be 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -332,6 +332,9 @@ function defaultValue(mtgMetaField $field) } else if($type->isBool()) { return $default ?? 'false'; } else if($type->isBlob()) { + if ($default == 'null') { + $default = 'nil'; + } return $default ?? 'nil'; } else { throw new Exception("Unknown type '$type'");