interface WidgetPluginInterface in Facets 8
Provides an interface describing the a facet widgets.
Hierarchy
- interface \Drupal\Component\Plugin\ConfigurableInterface; interface \Drupal\Component\Plugin\DependentPluginInterface
- interface \Drupal\facets\Widget\WidgetPluginInterface
Expanded class hierarchy of WidgetPluginInterface
All classes that implement WidgetPluginInterface
File
- src/
Widget/ WidgetPluginInterface.php, line 13
Namespace
Drupal\facets\WidgetView source
interface WidgetPluginInterface extends ConfigurableInterface, DependentPluginInterface {
/**
* Builds the facet widget for rendering.
*
* @param \Drupal\facets\FacetInterface $facet
* The facet we need to build.
*
* @return array
* A renderable array.
*/
public function build(FacetInterface $facet);
/**
* Picks the preferred query type for this widget.
*
* @return string|null
* The query type machine name to load or NULL to load the default query
* type.
*/
public function getQueryType();
/**
* Checks is a specific property is required for this widget.
*
* This works for base properties (show_only_one_result,
* only_visible_when_facet_source_is_visible) or one the processors.
*
* @param string $name
* The name of the property. Something like
* 'hide_non_narrowing_result_processor' or 'show_only_one_result'.
* @param string $type
* The type of the property. Either 'processors' or 'settings'. Another
* value will not be picked up by the widgets.
*
* @return bool
* True when the property is required, false by default.
*/
public function isPropertyRequired($name, $type);
/**
* Checks if the facet is supported by this processor.
*
* Reasons why this would be unsupported can be chosen by the processor.
*
* @param \Drupal\facets\FacetInterface $facet
* The facet to check for.
*
* @return bool
* Returns true when allowed, false otherwise.
*
* @see \Drupal\facets\Processor\ProcessorInterface::supportsFacet
*/
public function supportsFacet(FacetInterface $facet);
/**
* Provides a configuration form for this widget.
*
* @param array $form
* A form API form array.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state object.
* @param \Drupal\facets\FacetInterface $facet
* The facet entitu.
*
* @return array
* A renderable form array.
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state, FacetInterface $facet);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurableInterface:: |
public | function | Gets default configuration for this plugin. | 11 |
ConfigurableInterface:: |
public | function | Gets this plugin's configuration. | 12 |
ConfigurableInterface:: |
public | function | Sets the configuration for this plugin instance. | 12 |
DependentPluginInterface:: |
public | function | Calculates dependencies for the configured plugin. | 19 |
WidgetPluginInterface:: |
public | function | Builds the facet widget for rendering. | 1 |
WidgetPluginInterface:: |
public | function | Provides a configuration form for this widget. | 1 |
WidgetPluginInterface:: |
public | function | Picks the preferred query type for this widget. | 1 |
WidgetPluginInterface:: |
public | function | Checks is a specific property is required for this widget. | 1 |
WidgetPluginInterface:: |
public | function | Checks if the facet is supported by this processor. | 1 |