UNPKG

generator-beez

Version:
78 lines (70 loc) 2.29 kB
/** * @name index.js<beez-mymodule/model> * @author Octo Cat <octo@example.com> * @fileOvermodel beez-mymodule model */ (function (global) { define(function (require, exports, module) { 'use strict'; var beez = require('beez'); var logger = beez.getLogger('beez.mymodule.model'); var Model = beez.Model.extend( 'beez.mymodule.model', { midx: 'beez.mymodule', /** * initalize * @params {String} options.prefix * @params {Function} options.template */ initialize : function initialize(options) { // super Collection.__super__.initialize.apply(this, arguments); // normalize options = options || {}; /** * cache options * @type {Object} */ this.options = options; /** * midx * {String} */ this.midx = options.midx || this.midx; } } ); var Collection = beez.Collection.extend( 'beez.mymodule.collection', { midx: 'beez.mymodules', /** * initalize * @params {String} options.prefix * @params {Function} options.template */ initialize : function initialize(options) { // super Collection.__super__.initialize.apply(this, arguments); // normalize options = options || {}; /** * cache options * @type {Object} */ this.options = options; /** * midx * {String} */ this.midx = options.midx || this.midx; } } ); return { Model: Model, Collection: Collection }; }); })(this);