class MongoDebugCollection in MongoDB 7
Same name and namespace in other branches
- 6 mongodb.module \MongoDebugCollection
Hierarchy
- class \MongoDebugCollection
Expanded class hierarchy of MongoDebugCollection
File
- ./
mongodb.module, line 153 - Contains the main module connecting Drupal to MongoDB.
View source
class MongoDebugCollection {
/**
* Constructor.
*
* @param string $collection
* The collection to decorate.
*/
public function __construct($collection) {
$this->collection = $collection;
}
/**
* A decorator for the MongoCollection::find() method adding debug info.
*
* @param array|null $query
* A MongoCollection;:find()-compatible query array.
* @param array|null $fields
* A MongoCollection;:find()-compatible fields array.
*
* @return \MongoDebugCursor
* A debug cursor wrapping the decorated find() results.
*/
public function find($query = array(), $fields = array()) {
debug('find');
debug($query);
debug($fields);
return new MongoDebugCursor($this->collection
->find($query, $fields));
}
/**
* Decorates the standard __call() by debug()-ing its arguments.
*
* @param string $name
* The name of the called method.
* @param array $arguments
* The arguments for the decorated __call().
*
* @return mixed
* The result of the decorated __call().
*/
public function __call($name, array $arguments) {
debug($name);
debug($arguments);
return call_user_func_array(array(
$this->collection,
$name,
), $arguments);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MongoDebugCollection:: |
public | function | A decorator for the MongoCollection::find() method adding debug info. | |
MongoDebugCollection:: |
public | function | Decorates the standard __call() by debug()-ing its arguments. | |
MongoDebugCollection:: |
public | function | Constructor. |