aboutsummaryrefslogtreecommitdiffhomepage
path: root/Digitigrade/Model/PushableModel.php
blob: 9a3145350310bb3b5464939678b1a9d4dc138cfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
<?php
namespace Digitigrade\Model;

abstract class PushableModel extends FetchableModel implements \JsonSerializable {
    public static function importFromReceivedObject(\stdClass $obj, bool $autoSave = true): static {
        return static::createFromJson($obj);
        if ($autoSave) {
            $obj->save();
            $obj->finaliseAfterSave();
        }
    }
}