lithium\data\source\MongoDb::describe()
Implements
lithium\data\Source::describe()
Gets the column 'schema' for a given MongoDB collection. Only returns a schema if the
'schema'
configuration flag has been set in the constructor.
Parameters
-
mixed
$collection
Specifies a collection name for which the schema should be queried.
-
mixed
$fields
Any schema data pre-defined by the model.
-
array
$meta
Any meta information pre-defined in the model.
Returns
arrayReturns an associative array describing the given collection's schema.
Source
public function describe($collection, $fields = [], array $meta = []) {
if (!$fields && ($func = $this->_schema)) {
$fields = $func($this, $collection, $meta);
}
return Libraries::instance(null, 'schema', compact('fields'), $this->_classes);
}