ConfigurableSearchPluginBase.php in Drupal 10
File
core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php
View source
<?php
namespace Drupal\search\Plugin;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Form\FormStateInterface;
abstract class ConfigurableSearchPluginBase extends SearchPluginBase implements ConfigurableSearchPluginInterface {
protected $searchPageId;
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this
->setConfiguration($configuration);
}
public function defaultConfiguration() {
return [];
}
public function getConfiguration() {
return $this->configuration;
}
public function setConfiguration(array $configuration) {
$this->configuration = NestedArray::mergeDeep($this
->defaultConfiguration(), $configuration);
}
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
public function calculateDependencies() {
return [];
}
public function setSearchPageId($search_page_id) {
$this->searchPageId = $search_page_id;
return $this;
}
}