Store a filter.
@param {Filter} filter
329636
function(filter) {
        if (!filter) {
            return;
        }
        if (!this.filters[filter.userId]) {
            this.filters[filter.userId] = {};
        }
        this.filters[filter.userId][filter.filterId] = filter;
    }
1230967
function (filters) {
      if (!this.isArray(filters)) {
        throw 'Invalid filters type supplied. Expected Array.';
      }

      for (var i = 0; i < filters.length; i++) {
        this.enableFilter(filters[i]);
      }

      return this;
    }
223577
public function AddFilter( $filter )
	{
		$this->filters[] = $filter;

		if ( count( $this->filters ) <= 1 ) return;

		usort( $this->filters, function( /** @var Filter $a */ $a, /** @var Filter $b */ $b )
		{
			return $a->sortPriority > $b->sortPriority
				? 1
				: ( $a->sortPriority < $b->sortPriority ? -1 : 0 );
		} );
	}
523688
public function filter($filter)
    {
        if (is_array($filter)) {
            $filter = new Filter($filter);
        }
        $this->filter = $filter;
        return $this;
    }
1050479
function (data, filters) {
			this.writeDebug('filterData',arguments);
			var filterTest = true;

			for (var k in filters) {
				if (filters.hasOwnProperty(k)) {

					// Exclusive filtering
					if (this.settings.exclusiveFiltering === true || (this.settings.exclusiveTax !== null && Array.isArray(this.settings.exclusiveTax) && this.settings.exclusiveTax.indexOf(k) !== -1)) {
						var filterTests = filters[k];
						var exclusiveTest = [];

						if (typeof data[k] !== 'undefined') {
							for (var l = 0; l < filterTests.length; l++) {
								exclusiveTest[l] = new RegExp(filterTests[l], 'i').test(data[k].replace(/([^\x00-\x7F]|[.*+?^=!:${}()|\[\]\/\\]|&\s+)/g, ''));
							}
						}

						if (exclusiveTest.indexOf(true) === -1) {
							filterTest = false;
						}
					}
					// Inclusive filtering
					else {
						if (typeof data[k] === 'undefined' || !(new RegExp(filters[k].join(''), 'i').test(data[k].replace(/([^\x00-\x7F]|[.*+?^=!:${}()|\[\]\/\\]|&\s+)/g, '')))) {
							filterTest = false;
						}
					}
				}
			}

			if (filterTest) {
				return true;
			}
		}
97314
public function addFilter(Filter $filter)
    {
        $key = $filter->getKey();
        $this->filters[$key] = $filter;
    }
1164285
function filter(store, keyObj) {
      var size = 0;
      var data = store.data.asObject();
      var filteredData = {};
      var isArray = store.data.__sorted;
      var validItem;

      // If no key is specified retrieve root data
      if (keyObj && keyObj.constructor === Object) {
        if (isArray) {
          data = store.data.asArray();
          filteredData = [];

          for (var i = 0; i < data.length; i++) {
            validItem = true;
            // Loop through filter fields keys
            for (var key in keyObj) {
              // Data has the specified filter property
              if (data[i][key] !== keyObj[key]) {
                // Discard item from data
                validItem = false;
                break;
              }
            }
            // Add item to filtered data
            if (validItem) {
              filteredData.push(data[i]);
            }
          }
        } else {
          // Loop through store data
          for (var index in data) {
            validItem = true;
            // Loop through filter fields keys
            for (var key in keyObj) {
              // Data has the specified filter property
              if (data[index][key] !== keyObj[key]) {
                // Discard item from data
                validItem = false;
                break;
              }
            }
            // Add item to filtered data
            if (validItem) {
              filteredData[index] = data[index];
            }
          }
        }

        // Update store data object
        store.data = new Result(filteredData, store, store.data.__sorted);
      } 
      // Update store data items length
      store.size = Object.keys(filteredData).length;
    }
917071
public void addFilter(String filter) {

        if (CmsStringUtil.isNotEmpty(filter)) {
            filter = filter.trim().toLowerCase();
            if (FILTERS.contains(filter)) {
                m_filters.add(filter);
            }
        }
    }
461661
function buildFilters(filters) {
    var builtFilters = [];
    filters.forEach(function(filter) {
      builtFilters.push(MongoDatabase.buildFilter(filter));
    });
    return builtFilters;
  }
413483
public function addFilter(string $name, string $filter): void{
        $this->filters[$name] = $filter;
    }
1312777
private void addFilter(Filter filter) {
        boolean exists = false;
        for (Filter initedFilter : this.filters) {
            if (initedFilter.getClass() == filter.getClass()) {
                exists = true;
                break;
            }
        }

        if (!exists) {
            filter.init(this);
            this.filters.add(filter);
        }

    }
514331
function doDelete(filter) {
    console.log('doDelete', filter);
    return new Promise(function(resolve, reject) {
      var i, keysPromise, dataPromise;

      if (filter === true) {
        // Delete all
        if (options.cacheKeys) {
          keysPromise = Promise.resolve(cachedKeys);
        } else {
          keysPromise = readKeys();
        }

        keysPromise.then(function(existingKeys) {
          console.log('delete got existing keys', existingKeys);
          if (options.cacheValues) {
            cachedData = {};
          }
          if (options.cacheKeys) {
            cachedKeys = [];
          }

          saveData({}).then(function() {
            resolve(existingKeys);
          });
        }).catch(function(error) {
          reject(error);
        });

        return;
      } else if (common.keyTypes.indexOf(typeof filter) !== -1) {
        filter = [filter];
      } else if (filter instanceof Array) {
      } else if (typeof filter === 'object') {
        // Determine execution path for filter
        if (options.cacheValues) {
          dataPromise = Promise.resolve(cachedData);
        } else {
          dataPromise = readData();
        }

        dataPromise.then(function(data) {
          var deletedKeys = [];
          return common.processFilter(data, filter, function(id) {
            deletedKeys.push(id);
            delete data[id];
          }).then(function() {
            return saveData(data);
          }).then(function() {
            resolve(deletedKeys);
          });
        }).catch(function(error) {
          reject(error);
        });

        return;
      } else {
        reject({
          message: 'filter needs to be an object containing a filter'
        });
        return;
      }

      /* Check if we need to load the values key checking if the keys are
       *   actually in the database */
      if (!options.cacheValues && options.cacheKeys) {
        var haveKey = false;
        for (i in filter) {
          if(cachedKeys.indexOf(filter[i]) !== -1) {
            haveKey = true;
            break;
          }
        }
        if (haveKey) {
          dataPromise = readData();
        } else {
          resolve([]);
          return;
        }
      } else if (options.cacheValues) {
        dataPromise = Promise.resolve(cachedData);
      } else {
        dataPromise = readData();
      }

      dataPromise.then(function(data) {
        var deletedIds = [];
        // Go through and delete
        filter.forEach(function(id) {
          if (data[id] !== undefined) {
            delete data[id];
            deletedIds.push(id);
          }
        });

        return saveData(data).then(function() {
          resolve(deletedIds);
          return Promise.resolve();
        });
      }).catch(function(error) {
        reject(error);
      });
    });

  }
194372
function(target, filter) {
      _.each(slice.call(arguments, 2), function(source) {
        var prop, _results;
        _results = [];
        for (prop in source) {
          if (source[prop] !== void 0 && _.include(filter, prop)) {
            _results.push(target[prop] = source[prop]);
          } else {
            _results.push(void 0);
          }
        }
        return _results;
      });
      return target;
    }
69660
function store( $fieldFilters = null )
    {
        // Unset the cache
        global $eZContentObjectContentObjectCache;
        unset( $eZContentObjectContentObjectCache[$this->ContentObjectID] );
        global $eZContentObjectDataMapCache;
        unset( $eZContentObjectDataMapCache[$this->ContentObjectID] );

        $classAttribute = $this->contentClassAttribute();

        $dataType = $classAttribute->dataType();
        if ( $dataType )
        {
            $this->setAttribute( 'data_type_string', $classAttribute->attribute( 'data_type_string' ) );
            $this->updateSortKey( false );

            $db = eZDB::instance();
            $db->begin();

            // store the content data for this attribute
            $dataType->storeObjectAttribute( $this );

            parent::store( $fieldFilters );
            $dataType->postStore( $this );
            $db->commit();
        }
    }
287305
public void addFilter(Filter filter) {
    filter.setInitialContext(initialContext);

    int minIndex = Integer.MAX_VALUE;
    String[] before = filter.before();
    for (int i = 0; i < before.length; i++) {
        String s = before[i];
        int index = index(activeFilters, s);
        if (index < minIndex) {
          minIndex = index;
        }
      }
      if (minIndex == Integer.MAX_VALUE) {
        // -1 is more usable for not-found than MAX_VALUE
        minIndex = -1;
      }

    if (contains(filter.before(), FIRST_IN_PIPE)) {
      activeFilters.add(0, filter);
    } else if (minIndex != -1) {
      activeFilters.add(minIndex, filter);
    } else {
      activeFilters.add(filter);
    }
  }
899706
function(x, y, filter){
            var arr = this.get(x, y, filter);
            for(var i = arr.length - 1; i >= 0; i--){
                this.remove(arr[i]);
            }
        }
651183
public void updateFilter(String filter) {
    if (isInitialized) {
      LynxConfig lynxConfig = lynx.getConfig();
      lynxConfig.setFilter(filter);
      lynx.setConfig(lynxConfig);
      clearView();
      restartLynx();
    }
  }