From bd6aa7c9379c117ab256bf1a27814d9ac1714452 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9sar=20D=2E=20Rodas?= Date: Fri, 5 Mar 2010 04:14:05 -0300 Subject: [PATCH] Prevented specials document's properties being part of the current object. --- ActiveMongo.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ActiveMongo.php b/ActiveMongo.php index de1b551..acf277a 100644 --- a/ActiveMongo.php +++ b/ActiveMongo.php @@ -420,6 +420,9 @@ abstract class ActiveMongo implements Iterator /* Add our current resultset as our object's property */ foreach ((array)$obj as $key => $value) { + if ($key[0] == '$') { + continue; + } $this->$key = $value; } @@ -477,6 +480,9 @@ abstract class ActiveMongo implements Iterator if ($update) { $conn->update(array('_id' => $this->_id), $obj); foreach ($obj as $key => $value) { + if ($key[0] == '$') { + continue; + } $this->_current[$key] = $value; } $this->on_update(); -- 2.11.4.GIT