grunt-doctrine
Version:
Grunt plugin to convert doctrine xml annotations into backbone models and collections. Useful in conjunction with doctrine apigility. Includes option to scaffold an entire BBB application
44 lines (28 loc) • 860 B
JavaScript
define(function(require, exports, module) {
"use strict";
var logger = require('lib/console');
var app = require('app');
//var BaseModel = require('doctrine/model/ExpenseBase');
var Backbone = require("backbone");
//var Model = BaseModel.extend({
var Model = Backbone.Model.extend({
//idAttribute: 'espensesId',
url: function() {
if (this.isNew()) {
return app.api + 'expense';
}
return app.api + 'expense/' + this.getId();
},
initialize: function() {
},
getId: function() {
return this.get(this.idAttribute);
},
getLabel: function() {
return this.get(this.idAttribute);
},
validate: function(attrs, options) {
}
});
module.exports = Model;
});