class FacetapiQueryTypeDate in Facet API 7.2
Same name and namespace in other branches
- 6.3 plugins/facetapi/query_type.inc \FacetapiQueryTypeDate
- 7 plugins/facetapi/query_type.inc \FacetapiQueryTypeDate
Base class for date query type plugins.
Hierarchy
- class \FacetapiQueryType
- class \FacetapiQueryTypeDate
Expanded class hierarchy of FacetapiQueryTypeDate
File
- plugins/
facetapi/ query_type.inc, line 179 - Interfaces and base classes for query type plugins.
View source
class FacetapiQueryTypeDate extends FacetapiQueryType {
/**
* Overrides FacetapiQueryType::__construct().
*
* Lazy loads the date processing functions.
*/
public function __construct(FacetapiAdapter $adapter, array $facet) {
module_load_include('inc', 'facetapi', 'facetapi.date');
parent::__construct($adapter, $facet);
}
/**
* Overrides FacetapiQueryType::extract().
*
* Adds the "start" and "end" values for the date range.
*/
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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FacetapiQueryType:: |
protected | property | The adapter associated with facet being queried. | |
FacetapiQueryType:: |
protected | property | The facet definition as returned by facetapi_facet_load(). | |
FacetapiQueryType:: |
public | function | Returns the facet's active items. | |
FacetapiQueryType:: |
public | function | Convenience method to get the facet's global and per realm settings. | |
FacetapiQueryTypeDate:: |
public | function |
Overrides FacetapiQueryType::extract(). Overrides FacetapiQueryType:: |
|
FacetapiQueryTypeDate:: |
public | function |
Overrides FacetapiQueryType::__construct(). Overrides FacetapiQueryType:: |