protected function BlockPluginUI::facetCompare

Determines whether a given facet should be displayed for a plugin.

Compares a given plugin definition with the selected facet to determine if the plugin should be displayed in the user interface.

Parameters

string $facet: A colon separated string representing the key/value paring of a selected facet.

array $display_plugin_definition: The plugin definition to be compared.

Return value

bool Returns TRUE if the selected facet matches this plugin.

1 call to BlockPluginUI::facetCompare()
BlockPluginUI::form in drupal/core/modules/block/lib/Drupal/block/Plugin/PluginUI/BlockPluginUI.php
Overrides \Drupal\system\Plugin\PluginUIBase::form().

File

drupal/core/modules/block/lib/Drupal/block/Plugin/PluginUI/BlockPluginUI.php, line 205

Class

BlockPluginUI
Defines an overrideable UI for block selection, configuration, and placement.

Namespace

Drupal\block\Plugin\PluginUI

Code

protected function facetCompare($facet, $display_plugin_definition) {
  list($facet_type, $option) = explode(':', $facet);
  return $option == $display_plugin_definition[$facet_type];
}