abstract class FacetapiFilter in Facet API 6.3
Same name and namespace in other branches
- 7.2 plugins/facetapi/filter.inc \FacetapiFilter
- 7 plugins/facetapi/filter.inc \FacetapiFilter
Hierarchy
- class \FacetapiFilter
Expanded class hierarchy of FacetapiFilter
1 string reference to 'FacetapiFilter'
- facetapi_facetapi_filters in ./
facetapi.facetapi.inc - Implements hook_facetapi_filters().
File
- plugins/
facetapi/ filter.inc, line 11 - Base filter class and implementation.
View source
abstract class FacetapiFilter {
/**
* The ID of this plugin.
*/
protected $id;
/**
* The adapter object.
*
* @var FacetapiAdapter
*/
protected $adapter;
/**
* The facet settings.
*
* @var stdClass
*/
protected $settings;
/**
* Initializes the filter object.
*
* @param array $adapter
* The adapter object
* @param array $realm
* The realm being rendered.
* @param array $settings
* The realm settings.
* @param FacetapiFacet $facet
* The facet object.
*/
public function __construct($id, FacetapiAdapter $adapter, stdClass $settings) {
$this->id = $id;
$this->adapter = $adapter;
$this->settings = $settings;
$this->settings->settings += $this
->getDefaultSettings();
}
/**
* Filters the facet items.
*
* @param array $build
* The facet's render array.
*
* @return array
* The altered build array.
*/
public abstract function execute(array $build);
/**
* Adds settings to the filter form.
*/
public function settingsForm(&$form, &$form_state) {
// Nothing to do.
}
/**
* Returns default settings added to the settings form.
*/
public function getDefaultSettings() {
return array();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FacetapiFilter:: |
protected | property | The adapter object. | |
FacetapiFilter:: |
protected | property | The ID of this plugin. | |
FacetapiFilter:: |
protected | property | The facet settings. | |
FacetapiFilter:: |
abstract public | function | Filters the facet items. | 2 |
FacetapiFilter:: |
public | function | Returns default settings added to the settings form. | |
FacetapiFilter:: |
public | function | Adds settings to the filter form. | |
FacetapiFilter:: |
public | function | Initializes the filter object. |