Browse Source

updated MongoStatement to return retval on db.eval

master
Anton Grebnev 13 years ago
parent
commit
a950ff688f
  1. 7
      model/MongoStatement.php

7
model/MongoStatement.php

@ -60,6 +60,9 @@ class MongoStatement extends DbStatement
if (!$this->result) { if (!$this->result) {
return false; return false;
} }
if (isset($this->result['retval'])) {
return $this->result['retval'];
}
$row = false; $row = false;
switch ($style) { switch ($style) {
@ -112,6 +115,8 @@ class MongoStatement extends DbStatement
} else { } else {
return false; return false;
} }
} elseif (is_int($this->result)) {
return $this->result;
} }
return false; return false;
} }
@ -151,6 +156,8 @@ class MongoStatement extends DbStatement
if (is_array($result) && isset($result['values'])) { if (is_array($result) && isset($result['values'])) {
$this->result = $result['values']; $this->result = $result['values'];
} }
} elseif (is_int($result)) {
$this->result = $result;
} }
if ($request instanceof InsertMongoCommand) { if ($request instanceof InsertMongoCommand) {
$this->insertId = $request->getInsertId(); $this->insertId = $request->getInsertId();

Loading…
Cancel
Save