+ var result = (this.crmCriteria) ? _.extend({}, this.crmCriteria) : {};
+ if (this.crmReturn != null) {
+ result.return = this.crmReturn;
+ } else if (this.model && this.model.prototype.crmReturn != null) {
+ result.return = this.model.prototype.crmReturn;
+ }
+ return result;
+ },
+
+ /**
+ * Get an object which represents this collection's criteria
+ * as a live model. Any changes to the model will be applied
+ * to the collection, and the collection will be refreshed.
+ *
+ * @param criteriaModelClass
+ */
+ setCriteriaModel: function(criteriaModel) {
+ var collection = this;
+ this.crmCriteria = criteriaModel.toJSON();
+ this.listenTo(criteriaModel, 'change', function() {
+ collection.crmCriteria = criteriaModel.toJSON();
+ collection.debouncedFetch();
+ });