blob: 21415f70cb26d95cf905a86c992c8301981a5672 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
<?php
namespace Digitigrade\Model;
abstract class PushableModel extends FetchableModel implements \JsonSerializable {
public static function importFromReceivedObject(\stdClass $data, bool $autoSave = true): static {
$obj = static::createFromJson($data, $autoSave);
if ($autoSave) {
$obj->save();
$obj->finaliseAfterSave();
}
return $obj;
}
}
|