diff options
| -rw-r--r-- | Digitigrade/Model/PushableModel.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Digitigrade/Model/PushableModel.php b/Digitigrade/Model/PushableModel.php index 9a31453..2e47bd6 100644 --- a/Digitigrade/Model/PushableModel.php +++ b/Digitigrade/Model/PushableModel.php @@ -2,11 +2,12 @@ namespace Digitigrade\Model; abstract class PushableModel extends FetchableModel implements \JsonSerializable { - public static function importFromReceivedObject(\stdClass $obj, bool $autoSave = true): static { - return static::createFromJson($obj); + public static function importFromReceivedObject(\stdClass $data, bool $autoSave = true): static { + $obj = static::createFromJson($data); if ($autoSave) { $obj->save(); $obj->finaliseAfterSave(); } + return $obj; } }
\ No newline at end of file |
