From 2f4c1de3509141880df019ef1a6cc65981b3f6ea Mon Sep 17 00:00:00 2001 From: winter Date: Sat, 14 Dec 2024 21:24:48 +0000 Subject: implement outbound auth? untested untested because i don't have another instance to test it against .... --- Digitigrade/Model.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Digitigrade/Model.php') diff --git a/Digitigrade/Model.php b/Digitigrade/Model.php index 84e6439..b5c9e99 100644 --- a/Digitigrade/Model.php +++ b/Digitigrade/Model.php @@ -55,7 +55,7 @@ abstract class Model { foreach ($props as $p) { $pName = $p->getName(); if (!isset($this->{$pName})) - continue; + $this->{$pName} = null; // we need to determine the plain value to insert ... $value = $this->{$pName}; $discarded = false; @@ -213,9 +213,10 @@ abstract class Model { continue; $type = $reflType->getName(); if (is_subclass_of($type, Model::class) && !is_subclass_of($type, FetchableModel::class)) { - if (property_exists($this, 'id')) + if (isset($this->{$propName}) && property_exists($this, 'id')) { $this->{$propName}->setOwnerId($this->id); - $this->{$propName}->save(); + $this->{$propName}->save(); + } } } -- cgit v1.3