1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 'use strict';
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Dashboard
- *| (C) Copyright IBM Corp. 2019
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define(['underscore'], function (_) {
- 'use strict';
- /**
- * @return the JSON-like object for use in the query (stripped of attributes not relevant to query)
- */
- var ModelToQueryJSON = function () {
- function ModelToQueryJSON() {
- _classCallCheck(this, ModelToQueryJSON);
- }
- ModelToQueryJSON.prototype.toQueryJSON = function toQueryJSON() {
- var _this = this;
- var o = this.toJSON(null, this.queryBlacklistAttrs);
- _.each(_.extend({}, this.nestedCollections, this.nestedModels), function (modelClass, modelName) {
- if (o[modelName]) {
- var modelObj = _this.get(modelName);
- if (modelObj && modelObj.toQueryJSON) {
- var modelQueryJSON = modelObj.toQueryJSON();
- o[modelName] = modelQueryJSON;
- }
- }
- });
- return o;
- };
- return ModelToQueryJSON;
- }();
- return ModelToQueryJSON;
- });
- //# sourceMappingURL=ModelToQueryJSON.js.map
|