You are here

public function FacetapiWidget::__construct in Facet API 6.3

Same name and namespace in other branches
  1. 7.2 plugins/facetapi/widget.inc \FacetapiWidget::__construct()
  2. 7 plugins/facetapi/widget.inc \FacetapiWidget::__construct()

Parameters

string $id: The machine readable name of the widget.

array $realm: The realm being rendered.

array $settings: The realm settings.

FacetapiFacet $facet: The facet object.

1 call to FacetapiWidget::__construct()
FacetapiWidgetLinks::__construct in plugins/facetapi/widget_links.inc
Overrides constructor to reset the key.
1 method overrides FacetapiWidget::__construct()
FacetapiWidgetLinks::__construct in plugins/facetapi/widget_links.inc
Overrides constructor to reset the key.

File

plugins/facetapi/widget.inc, line 72
Abstract widget plugin class.

Class

FacetapiWidget
Base class for widget plugins.

Code

public function __construct($id, array $realm, FacetapiFacet $facet, stdClass $settings) {

  // Stores variables.
  $this->id = $id;
  $this->realm = $realm;
  $this->settings = $settings;
  $this->settings->settings += $this
    ->getDefaultSettings();
  $this->facet = $facet;

  // Sets the key of the element when appended to the realm's render array.
  $this->key = $facet['field alias'];
}