new BaseRepository(app, util)
Create repository
Parameters:
Name | Type | Description |
---|---|---|
app |
App | The application |
util |
Util | Util service |
Members
-
<static> provides :string
-
Service name is 'repositories.base'
Type:
- string
-
<static> requires :Array.<string>
-
Dependencies as constructor arguments
Type:
- Array.<string>
-
<static> instance :string
-
DB instance
Type:
- string
-
<static> table :string
-
DB table name - override it
Type:
- string
-
<static> model :string
-
Model name - override it
Type:
- string
-
<static> timeZone :string|null
-
Table time zone - override it
Type:
- string | null
Methods
-
getRepository( [name])
-
Get repository
Parameters:
Name Type Argument Description name
string <optional>
Repository name Returns:
- Type
- object
-
getModel( [name] [, data])
-
Get model
Parameters:
Name Type Argument Description name
string <optional>
Model name, defaults to the model of this class data
undefined | object | Array.<object> <optional>
Data to to load Returns:
If data is an array returns array of models otherwise a single model- Type
- object | Array.<object>
-
_loadMethods(dir)
-
Load methods from given directory
Parameters:
Name Type Description dir
string Directory full path