aboutsummaryrefslogtreecommitdiffhomepage
path: root/Digitigrade/Model.php
diff options
context:
space:
mode:
authorwinter2024-12-14 21:24:48 +0000
committerwinter2024-12-14 21:45:59 +0000
commit2f4c1de3509141880df019ef1a6cc65981b3f6ea (patch)
tree0021f3a860d6c80869d4af5d366393f1d0eea288 /Digitigrade/Model.php
parent0c6497ff02b8118bcefee37cc6fe0cbc02df4bb4 (diff)
implement outbound auth? untested
untested because i don't have another instance to test it against ....
Diffstat (limited to 'Digitigrade/Model.php')
-rw-r--r--Digitigrade/Model.php7
1 files changed, 4 insertions, 3 deletions
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();
+ }
}
}