Skip to content

Commit

Permalink
#34 #39 fixed the handling wth model (no array)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Franek committed Aug 31, 2018
1 parent eae32ea commit c1ef576
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Types/TypeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down

0 comments on commit c1ef576

Please sign in to comment.