Members
(static) dependencies :Array.<string>
Class dependencies:
['db.orm']
.
Methods
set(name, Model)
Register a model.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The model name. |
Model |
database.Model | The model instance. |
Returns:
The current ModelRepository instance.
get(name)
Get a model by name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The model name. |
Throws:
-
Indicates that the model was not found.
- Type
- TypeError
Returns:
The model instance.
- Type
- database.Model
has(name)
Check if a model exists.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The model name. |
Returns:
Indicates that the model exists.
- Type
- boolean