Commit 94fc1e30 authored by vstaikov's avatar vstaikov Committed by Alexander Butenko

Keep objects mapped (#763)

A fix for the objects mapping.
parent e3497b7e
...@@ -385,14 +385,14 @@ class dbObject { ...@@ -385,14 +385,14 @@ class dbObject {
if ($this->db->count == 0) if ($this->db->count == 0)
return null; return null;
foreach ($results as &$r) { foreach ($results as $k => &$r) {
$this->processArrays ($r); $this->processArrays ($r);
$this->data = $r; $this->data = $r;
$this->processAllWith ($r, false); $this->processAllWith ($r, false);
if ($this->returnType == 'Object') { if ($this->returnType == 'Object') {
$item = new static ($r); $item = new static ($r);
$item->isNew = false; $item->isNew = false;
$objects[] = $item; $objects[$k] = $item;
} }
} }
$this->_with = Array(); $this->_with = Array();
...@@ -476,14 +476,14 @@ class dbObject { ...@@ -476,14 +476,14 @@ class dbObject {
self::$totalPages = $this->db->totalPages; self::$totalPages = $this->db->totalPages;
if ($this->db->count == 0) return null; if ($this->db->count == 0) return null;
foreach ($res as &$r) { foreach ($res as $k => &$r) {
$this->processArrays ($r); $this->processArrays ($r);
$this->data = $r; $this->data = $r;
$this->processAllWith ($r, false); $this->processAllWith ($r, false);
if ($this->returnType == 'Object') { if ($this->returnType == 'Object') {
$item = new static ($r); $item = new static ($r);
$item->isNew = false; $item->isNew = false;
$objects[] = $item; $objects[$k] = $item;
} }
} }
$this->_with = Array(); $this->_with = Array();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment