You are here

class FacetapiQueryTypeDate in Facet API 6.3

Same name and namespace in other branches
  1. 7.2 plugins/facetapi/query_type.inc \FacetapiQueryTypeDate
  2. 7 plugins/facetapi/query_type.inc \FacetapiQueryTypeDate

Base class for date query type plugins.

Hierarchy

Expanded class hierarchy of FacetapiQueryTypeDate

1 string reference to 'FacetapiQueryTypeDate'
facetapi_facetapi_query_types in ./facetapi.facetapi.inc

File

plugins/facetapi/query_type.inc, line 110
Interfaces and base classes for query type plugins.

View source
class FacetapiQueryTypeDate extends FacetapiQueryType {

  /**
   * Loads the include file containing the date API functions.
   */
  public function __construct(FacetapiAdapter $adapter, array $facet) {
    module_load_include('inc', 'facetapi', 'facetapi.date');
    parent::__construct($adapter, $facet);
  }

  /**
   * Parses the start and end values for the date.
   */
  public function extract(array $item) {
    $return = array();
    if (preg_match(FACETAPI_REGEX_DATE_RANGE, $item['value'], $matches)) {
      $return['start'] = $matches[1];
      $return['end'] = $matches[8];
    }
    return $return;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FacetapiQueryType::$adapter protected property The adapter object.
FacetapiQueryType::$facet protected property The facet definition.
FacetapiQueryType::getActiveItems public function Returns the facet's active items.
FacetapiQueryType::getSettings public function Returns settings.
FacetapiQueryTypeDate::extract public function Parses the start and end values for the date. Overrides FacetapiQueryType::extract
FacetapiQueryTypeDate::__construct public function Loads the include file containing the date API functions. Overrides FacetapiQueryType::__construct