lib/storages/ResourceFilter.js
function addLogicalOperation(filters, operator) {
  for (var i = 0; i < filters.length; i++)
    if (!(filters[i] instanceof ResourceFilter)) throw new TypeError('Invalid filters');

  if (this.hasOperation(operator)) {

    // This logical operator already exists in the list of operations
    // Just add the new filters to the operator

    for (var operation of this.operations) {
      if (operation.type === operator)
        operation.filters = operation.filters.concat(filters);
    }

  } else {

    // This logical operator does not exist yet in the list of operations

    this.operations.push({
      type: operator,
      filters: filters
    });
  }

  return this;
}
function addLogicalOperation(filters, operator) {
  for (var i = 0; i < filters.length; i++)
    if (!(filters[i] instanceof ResourceFilter)) throw new TypeError('Invalid filters');

  if (this.hasOperation(operator)) {

    // This logical operator already exists in the list of operations
    // Just add the new filters to the operator

    for (var operation of this.operations) {
      if (operation.type === operator)
        operation.filters = operation.filters.concat(filters);
    }

  } else {

    // This logical operator does not exist yet in the list of operations

    this.operations.push({
      type: operator,
      filters: filters
    });
  }

  return this;
}
function addLogicalOperation ( filters , operator ) { for ( var i = 0 ; i < filters . length ; i ++ ) if ( ! ( filters [ i ] instanceof ResourceFilter ) ) throw new TypeError ( 'Invalid filters' ) ; if ( this . hasOperation ( operator ) ) { // This logical operator already exists in the list of operations // Just add the new filters to the operator for ( var operation of this . operations ) { if ( operation . type === operator ) operation . filters = operation . filters . concat ( filters ) ; } } else { // This logical operator does not exist yet in the list of operations this . operations . push ( { type : operator , filters : filters } ) ; } return this ; }
Adds a logical operation to the filter.

Only one logical operation can be added in a filter.

@method addLogicalOperation
@private
@param {Array} filters The list of filters
@return {ResourceFilter} The actual filter
@throws {TypeError} An error if field and / or value is not valid
Adds a logical operation to the filter .