R2MModel.js 593 B

1234567891011121314151617181920212223242526
  1. "use strict"
  2. var Model = require('./Model.js');
  3. var R2M_Client = require('./lib/r2m/Client.js');
  4. class R2MModel extends Model {
  5. constructor(tableName, dbKey, cacheKey) {
  6. super(tableName, dbKey);
  7. this.cacheKey = cacheKey || 'default';
  8. this._getHelper();
  9. }
  10. _getHelper() {
  11. if (!this.objR2m) {
  12. this.objR2m = new R2M_Client(this.tableName, this.dbKey, this.cacheKey);
  13. }
  14. return this.objR2m;
  15. }
  16. // getRedis() {
  17. // return dwRedis::init($this->cacheKey);
  18. // }
  19. }
  20. module.exports = R2MModel;