@absolunet/ioc2.1.0

View on GitHub

ModelRepository

Model repository that bridges the application models with the ORM engine.

Members

(static) dependencies :Array.<string>

Source:
Class dependencies: ['db.orm'].

Methods

set(name, Model)

Source:
Register a model.
Parameters:
Name Type Description
name string The model name.
Model database.Model The model instance.
Returns:
The current ModelRepository instance.
Type
database.repositories.ModelRepository

get(name)

Source:
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)

Source:
Check if a model exists.
Parameters:
Name Type Description
name string The model name.
Returns:
Indicates that the model exists.
Type
boolean