public function SliderWidget::isPropertyRequired in Facets 8
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.
Parameters
string $name: The name of the property. Something like 'hide_non_narrowing_result_processor' or 'show_only_one_result'.
string $type: The type of the property. Either 'processors' or 'settings'. Another value will not be picked up by the widgets.
Return value
bool True when the property is required, false by default.
Overrides WidgetPluginBase::isPropertyRequired
1 method overrides SliderWidget::isPropertyRequired()
- RangeSliderWidget::isPropertyRequired in modules/
facets_range_widget/ src/ Plugin/ facets/ widget/ RangeSliderWidget.php - Checks is a specific property is required for this widget.
File
- modules/
facets_range_widget/ src/ Plugin/ facets/ widget/ SliderWidget.php, line 168
Class
- SliderWidget
- The slider widget.
Namespace
Drupal\facets_range_widget\Plugin\facets\widgetCode
public function isPropertyRequired($name, $type) {
if ($name === 'slider' && $type === 'processors') {
return TRUE;
}
if ($name === 'show_only_one_result' && $type === 'settings') {
return TRUE;
}
return FALSE;
}