aboutsummaryrefslogtreecommitdiff
path: root/lib/models/SimpleORMap.class.php
diff options
context:
space:
mode:
authorAndré Noack <noack@data-quest.de>2022-04-20 15:40:26 +0000
committerAndré Noack <noack@data-quest.de>2022-04-20 15:40:26 +0000
commite9c5a61a21d57b3d14a0ed7beeaaf63f841859e0 (patch)
tree50c5763c1299e924bce7cdd783b497224e24e7eb /lib/models/SimpleORMap.class.php
parent180a7962d3b7e02552c964f9301f817e242d7864 (diff)
Resolve #878 SORM-Konstruktor kann keinen unvollständigen PK setzen
Closes #878
Diffstat (limited to 'lib/models/SimpleORMap.class.php')
-rw-r--r--lib/models/SimpleORMap.class.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/models/SimpleORMap.class.php b/lib/models/SimpleORMap.class.php
index 8397fa0..cc51138 100644
--- a/lib/models/SimpleORMap.class.php
+++ b/lib/models/SimpleORMap.class.php
@@ -1192,7 +1192,7 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate
} else {
$id = [];
foreach ($this->pk as $key) {
- if ($this->content[$key] !== null) {
+ if (array_key_exists($key, $this->content)) {
$id[] = $this->content[$key];
}
}
@@ -1782,11 +1782,11 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate
function restore()
{
$where_query = $this->getWhereQuery();
+ $id = $this->getId();
if ($where_query) {
if ($this->applyCallbacks('before_initialize') === false) {
return false;
}
- $id = $this->getId();
$this->initializeContent();
$query = "SELECT * FROM `{$this->db_table}` WHERE "
. join(" AND ", $where_query);