/src/Oro/Bundle/EmailBundle/Resources/public/js/email/template/collection.js
JavaScript | 32 lines | 15 code | 3 blank | 14 comment | 0 complexity | 9b84c2ef2fde07e850d15279a43fc5aa MD5 | raw file
- /*global define*/
- define(['backbone', 'routing', './model'
- ], function (Backbone, routing, EmailTemplateModel) {
- 'use strict';
- /**
- * @export oroemail/js/email/template/collection
- * @class oroemail.email.template.Collection
- * @extends Backbone.Collection
- */
- return Backbone.Collection.extend({
- route: 'oro_api_get_emailtemplate',
- url: null,
- model: EmailTemplateModel,
- /**
- * Constructor
- */
- initialize: function () {
- this.url = routing.generate(this.route, {entityName: null});
- },
- /**
- * Regenerate route for selected entity
- *
- * @param id {String}
- */
- setEntityId: function (id) {
- this.url = routing.generate(this.route, {entityName: id});
- }
- });
- });