This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
2016-03-09 14:33:45 -05:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const container = require('../Container');
|
2016-06-14 10:51:48 -04:00
|
|
|
const Config = container.get('Config');
|
|
|
|
const DBModel = container.getBase('DBModel');
|
2016-03-09 14:33:45 -05:00
|
|
|
|
2016-06-14 10:51:48 -04:00
|
|
|
class UserModel extends DBModel {
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
getAll() {
|
|
|
|
return this.db.get('users');
|
|
|
|
}
|
|
|
|
|
|
|
|
getUserById(userId) {
|
|
|
|
return this.db.from('users')
|
|
|
|
.where('id', userId)
|
|
|
|
.get();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = new UserModel();
|