/// <reference path="../../typings/tsd.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var DDolly = require('../Dolly');
var DDatabase = require('../../dolly/config/Database');
var Dollyjs;
(function (Dollyjs) {
/**
* @class ExModel
* Extended Mondel
*/
var ExModel = (function (_super) {
__extends(ExModel, _super);
/**
* @constructs ExModel
* Initialize the object
* @param modelName
*/
function ExModel(modelName) {
_super.call(this);
if (modelName) {
this.modelName = modelName;
this.setModel();
}
}
Object.defineProperty(ExModel.prototype, "modelName", {
/**
* @returns {any}
* @public
*/
get: function () {
return this._modelName;
},
/**
* @param value
* @public
*/
set: function (value) {
this._modelName = value;
},
enumerable: true,
configurable: true
});
/**
* @public Define the model
*/
ExModel.prototype.setModel = function () {
this.model = DDatabase.Database.models[this.modelName];
};
return ExModel;
})(DDolly.Dolly);
Dollyjs.ExModel = ExModel;
})(Dollyjs || (Dollyjs = {}));
module.exports = Dollyjs;
//# sourceMappingURL=ExModel.js.map