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) • 863 B
JavaScript
define(function(require, exports, module) {
"use strict";
var logger = require('lib/console');
var app = require('app');
//var BaseModel = require('doctrine/model/CategoryBase');
var Backbone = require("backbone");
//var Model = BaseModel.extend({
var Model = Backbone.Model.extend({
//idAttribute: 'categoryId',
url: function() {
if (this.isNew()) {
return app.api + 'category';
}
return app.api + 'category/' + 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;
});