You are here

filter_search_start.inc in Commerce Search API 7

FacetApiFilter, remove items that should not appear on empty search.

File

includes/facetapi/filter_search_start.inc
View source
<?php

/**
 * @file
 * FacetApiFilter, remove items that should not appear on empty search.
 */

/**
 * Filter out items should not appear on empty search.
 */
class CommerceSearchApiSearchStart extends FacetapiFilter {

  /**
   * Returns an empty array.
   */
  public function execute(array $build) {
    if (!count($this->adapter
      ->getAllActiveItems())) {
      return array();
    }
    return $build;
  }

}

Classes

Namesort descending Description
CommerceSearchApiSearchStart Filter out items should not appear on empty search.