/src/Oro/Bundle/CalendarBundle/Resources/public/js/calendar/connection/collection.js
JavaScript | 25 lines | 12 code | 2 blank | 11 comment | 0 complexity | 73ff462af3449b40ce26f371f2e65d93 MD5 | raw file
- /*global define*/
- define(['backbone', 'routing', 'orocalendar/js/calendar/connection/model'
- ], function (Backbone, routing, ConnectionModel) {
- 'use strict';
- /**
- * @export orocalendar/js/calendar/connection/collection
- * @class oro.calendar.connection.Collection
- * @extends Backbone.Collection
- */
- return Backbone.Collection.extend({
- route: 'oro_api_get_calendar_connections',
- url: null,
- model: ConnectionModel,
- /**
- * Sets a calendar this collection works with
- *
- * @param {int} calendarId
- */
- setCalendar: function (calendarId) {
- this.url = routing.generate(this.route, {id: calendarId});
- }
- });
- });