abstract class ConfigurableSearchPluginBase in Drupal 10
Same name and namespace in other branches
- 8 core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php \Drupal\search\Plugin\ConfigurableSearchPluginBase
- 9 core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php \Drupal\search\Plugin\ConfigurableSearchPluginBase
Provides a base implementation for a configurable Search plugin.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\search\Plugin\SearchPluginBase implements RefinableCacheableDependencyInterface, ContainerFactoryPluginInterface, SearchInterface uses RefinableCacheableDependencyTrait
- class \Drupal\search\Plugin\ConfigurableSearchPluginBase implements ConfigurableSearchPluginInterface
- class \Drupal\search\Plugin\SearchPluginBase implements RefinableCacheableDependencyInterface, ContainerFactoryPluginInterface, SearchInterface uses RefinableCacheableDependencyTrait
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of ConfigurableSearchPluginBase
3 files declare their use of ConfigurableSearchPluginBase
- EntitySearchPage.php in core/
modules/ search/ src/ Plugin/ migrate/ destination/ EntitySearchPage.php - NodeSearch.php in core/
modules/ node/ src/ Plugin/ Search/ NodeSearch.php - SearchExtraTypeSearch.php in core/
modules/ search/ tests/ modules/ search_extra_type/ src/ Plugin/ Search/ SearchExtraTypeSearch.php
File
- core/
modules/ search/ src/ Plugin/ ConfigurableSearchPluginBase.php, line 11
Namespace
Drupal\search\PluginView source
abstract class ConfigurableSearchPluginBase extends SearchPluginBase implements ConfigurableSearchPluginInterface {
/**
* The unique ID for the search page using this plugin.
*
* @var string
*/
protected $searchPageId;
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this
->setConfiguration($configuration);
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [];
}
/**
* {@inheritdoc}
*/
public function getConfiguration() {
return $this->configuration;
}
/**
* {@inheritdoc}
*/
public function setConfiguration(array $configuration) {
$this->configuration = NestedArray::mergeDeep($this
->defaultConfiguration(), $configuration);
}
/**
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
return [];
}
/**
* {@inheritdoc}
*/
public function setSearchPageId($search_page_id) {
$this->searchPageId = $search_page_id;
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableDependencyTrait:: |
protected | property | Cache contexts. | |
CacheableDependencyTrait:: |
protected | property | Cache max-age. | |
CacheableDependencyTrait:: |
protected | property | Cache tags. | |
CacheableDependencyTrait:: |
public | function | ||
CacheableDependencyTrait:: |
public | function | ||
CacheableDependencyTrait:: |
public | function | ||
CacheableDependencyTrait:: |
protected | function | Sets cacheability; useful for value object constructors. | |
ConfigurableSearchPluginBase:: |
protected | property | The unique ID for the search page using this plugin. | |
ConfigurableSearchPluginBase:: |
public | function |
Calculates dependencies for the configured plugin. Overrides DependentPluginInterface:: |
|
ConfigurableSearchPluginBase:: |
public | function |
Gets default configuration for this plugin. Overrides ConfigurableInterface:: |
1 |
ConfigurableSearchPluginBase:: |
public | function |
Gets this plugin's configuration. Overrides ConfigurableInterface:: |
|
ConfigurableSearchPluginBase:: |
public | function |
Sets the configuration for this plugin instance. Overrides ConfigurableInterface:: |
|
ConfigurableSearchPluginBase:: |
public | function |
Sets the ID for the search page using this plugin. Overrides ConfigurableSearchPluginInterface:: |
|
ConfigurableSearchPluginBase:: |
public | function |
Form validation handler. Overrides PluginFormInterface:: |
|
ConfigurableSearchPluginBase:: |
public | function |
Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase:: |
|
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
public | function | 2 | |
DependencySerializationTrait:: |
public | function | 2 | |
MessengerTrait:: |
protected | property | The messenger. | 18 |
MessengerTrait:: |
public | function | Gets the messenger. | 18 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function | ||
PluginBase:: |
public | function | ||
PluginBase:: |
public | function | 2 | |
PluginBase:: |
public | function | ||
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginFormInterface:: |
public | function | Form constructor. | 19 |
PluginFormInterface:: |
public | function | Form submission handler. | 17 |
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
SearchInterface:: |
public | function | Executes the search. | 1 |
SearchPluginBase:: |
protected | property | The keywords to use in a search. | |
SearchPluginBase:: |
protected | property | Array of attributes - usually from the request object. | |
SearchPluginBase:: |
protected | property | Array of parameters from the query string from the request. | |
SearchPluginBase:: |
public | function |
Executes the search and builds render arrays for the result items. Overrides SearchInterface:: |
1 |
SearchPluginBase:: |
public | function |
Builds the URL GET query parameters array for search. Overrides SearchInterface:: |
|
SearchPluginBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
SearchPluginBase:: |
public | function |
Returns the currently set attributes (from the request). Overrides SearchInterface:: |
|
SearchPluginBase:: |
public | function |
Returns the searching help. Overrides SearchInterface:: |
|
SearchPluginBase:: |
public | function |
Returns the currently set keywords of the plugin instance. Overrides SearchInterface:: |
|
SearchPluginBase:: |
public | function |
Returns the current parameters set using setSearch(). Overrides SearchInterface:: |
|
SearchPluginBase:: |
public | function |
Returns the search index type this plugin uses. Overrides SearchInterface:: |
|
SearchPluginBase:: |
public | function |
Verifies if the values set via setSearch() are valid and sufficient. Overrides SearchInterface:: |
1 |
SearchPluginBase:: |
public | function |
Alters the search form when being built for a given plugin. Overrides SearchInterface:: |
|
SearchPluginBase:: |
public | function |
Sets the keywords, parameters, and attributes to be used by execute(). Overrides SearchInterface:: |
1 |
SearchPluginBase:: |
public | function |
Provides a suggested title for a page of search results. Overrides SearchInterface:: |
|
SearchPluginBase:: |
public | function |
Returns whether or not search results should be displayed in admin theme. Overrides SearchInterface:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 3 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 1 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |