You are here

protected function SolrFilterSubQuery::unsetFilter in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 Solr_Base_Query.php \SolrFilterSubQuery::unsetFilter()
  2. 6.3 Solr_Base_Query.php \SolrFilterSubQuery::unsetFilter()
1 call to SolrFilterSubQuery::unsetFilter()
SolrFilterSubQuery::removeFilter in ./Solr_Base_Query.php

File

./Solr_Base_Query.php, line 89
This class allows you to make operations on a query that will be sent to Apache Solr. methods such as adding and removing sorts, remove and replace parameters, adding and removing filters, getters and setters for various parameters and more

Class

SolrFilterSubQuery
This class allows you to make operations on a query that will be sent to Apache Solr. methods such as adding and removing sorts, remove and replace parameters, adding and removing filters, getters and setters for various parameters and…

Code

protected function unsetFilter(&$fields, $name, $value, $exclude) {
  if (!isset($value)) {
    foreach ($fields as $pos => $values) {
      if ($values['#name'] == $name) {
        unset($fields[$pos]);
      }
    }
  }
  else {
    foreach ($fields as $pos => $values) {
      if ($values['#name'] == $name && $values['#value'] == $value && $values['#exclude'] == $exclude) {
        unset($fields[$pos]);
      }
    }
  }
}