lithium\data\source\MongoDb::sources()
Implements
lithium\data\Source::sources()
Returns the list of collections in the currently-connected database.
Parameters
-
string
$class
The fully-name-spaced class name of the model object making the request.
Returns
arrayReturns an array of objects to which models can connect.
Source
public function sources($class = null) {
$this->_checkConnection();
$conn = $this->connection;
return array_map(function($col) { return $col->getName(); }, $conn->listCollections());
}