From c1ef576af7c5dde807f84eec2293812c1c2da021 Mon Sep 17 00:00:00 2001 From: Tobias Franek Date: Fri, 31 Aug 2018 16:56:58 +0200 Subject: [PATCH] #34 #39 fixed the handling wth model (no array) --- src/Types/TypeHandler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Types/TypeHandler.php b/src/Types/TypeHandler.php index 0a39b33..59f6a7a 100755 --- a/src/Types/TypeHandler.php +++ b/src/Types/TypeHandler.php @@ -73,7 +73,11 @@ public function handle(AbstractModel &$model, array $data, array $fields) : void $implements = class_implements(self::$types[$value['type']]); if (isset($implements[TypeInterface::class])) { if(($value['type'] == 'model' || $value['type'] == 'modelCollection') && (isset($instanceConfig['ignore_children']) && $instanceConfig['ignore_children'])) { - self::$types['array']::execute($model, $data, [$key => $value]); + if($value['type'] == 'model') { + self::$types['int']::execute($model, $data, [$key => $value]); + } else { + self::$types['array']::execute($model, $data, [$key => $value]); + } } else { self::$types[$value['type']]::execute($model, $data, [$key => $value]); }