5 * Contains \Drupal\linkit\MatcherBase.
8 namespace Drupal\linkit;
10 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
11 use Drupal\Core\Plugin\PluginBase;
14 * Provides a base class for matchers.
18 abstract class MatcherBase extends PluginBase implements MatcherInterface, ContainerFactoryPluginInterface {
28 * The weight of the matcher compared to others in a matcher collection.
32 protected $weight = 0;
37 public function __construct(array $configuration, $plugin_id, $plugin_definition) {
38 parent::__construct($configuration, $plugin_id, $plugin_definition);
40 $this->setConfiguration($configuration);
46 public function getUuid() {
53 public function getLabel() {
54 return $this->pluginDefinition['label'];
60 public function getSummary() {
67 public function getWeight() {
74 public function setWeight($weight) {
75 return $this->weight = $weight;
81 public function getConfiguration() {
83 'uuid' => $this->getUuid(),
84 'id' => $this->getPluginId(),
85 'weight' => $this->getWeight(),
86 'settings' => $this->configuration,
93 public function setConfiguration(array $configuration) {
99 $this->configuration = $configuration['settings'] + $this->defaultConfiguration();
100 $this->uuid = $configuration['uuid'];
101 $this->weight = $configuration['weight'];
108 public function defaultConfiguration() {
115 public function calculateDependencies() {