Commit 30444c7a authored by Jeremy Mikola's avatar Jeremy Mikola

Restore Collection::_massageFindAndModifyOptions()

This was inadvertently removed in 495e46d4.
parent 719fd253
...@@ -1159,6 +1159,26 @@ class Collection ...@@ -1159,6 +1159,26 @@ class Collection
return $options; return $options;
} }
/**
* Internal helper for massaging findandmodify options
* @internal
*/
final protected function _massageFindAndModifyOptions($options, $update = array())
{
$ret = array(
"sort" => $options["sort"],
"new" => isset($options["returnDocument"]) ? $options["returnDocument"] == self::FIND_ONE_AND_RETURN_AFTER : false,
"fields" => $options["projection"],
"upsert" => isset($options["upsert"]) ? $options["upsert"] : false,
);
if ($update) {
$ret["update"] = $update;
} else {
$ret["remove"] = true;
}
return $ret;
}
/** /**
* Constructs the Query Wire Protocol field 'flags' based on $options * Constructs the Query Wire Protocol field 'flags' based on $options
* provided to other helpers * provided to other helpers
......
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