refactored MongoModel to hide fetch method, fixed PHPDoc errors
This commit is contained in:
@ -38,6 +38,12 @@ class MongoDriver extends NoSqlDbDriver
|
||||
return $this->query($command, $params)->affectedRows();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $collection Mongo collection name to search in
|
||||
* @param array $condition Search conditions
|
||||
* @param array $fields Fields to return in result set
|
||||
* @return MongoStatement
|
||||
*/
|
||||
public function find($collection, $condition = array(), $fields = array())
|
||||
{
|
||||
$command = MongoCommandBuilder::factory(MongoCommandBuilder::FIND, $this->getCollection($collection));
|
||||
@ -49,17 +55,6 @@ class MongoDriver extends NoSqlDbDriver
|
||||
return $this->query($command, $params);
|
||||
}
|
||||
|
||||
public function get($collection, $condition, $fields = array())
|
||||
{
|
||||
$command = MongoCommandBuilder::factory(MongoCommandBuilder::FIND, $this->getCollection($collection));
|
||||
$params = array(
|
||||
'condition' => $condition,
|
||||
'fields' => $fields,
|
||||
'multiple' => false
|
||||
);
|
||||
return $this->query($command, $params);
|
||||
}
|
||||
|
||||
public function findAndModify($collection, $query, $update, $sort = array(), $field = array(), $upsert = false, $new = false, $remove = false)
|
||||
{
|
||||
$command = MongoCommandBuilder::factory(MongoCommandBuilder::COMMAND, $this->getCollection($collection));
|
||||
@ -123,10 +118,9 @@ class MongoDriver extends NoSqlDbDriver
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $request
|
||||
* @return DbStatement
|
||||
* @return MongoStatement
|
||||
*/
|
||||
public function prepare($request)
|
||||
{
|
||||
|
Reference in New Issue
Block a user