You are here

public function FieldValidationRuleBase::setConfiguration in Field Validation 8

Sets the configuration for this plugin instance.

Parameters

array $configuration: An associative array containing the plugin's configuration.

Overrides ConfigurableInterface::setConfiguration

1 call to FieldValidationRuleBase::setConfiguration()
FieldValidationRuleBase::__construct in src/FieldValidationRuleBase.php
Constructs a \Drupal\Component\Plugin\PluginBase object.

File

src/FieldValidationRuleBase.php, line 180

Class

FieldValidationRuleBase
Provides a base class for FieldValidationRule.

Namespace

Drupal\field_validation

Code

public function setConfiguration(array $configuration) {
  $configuration += [
    'data' => [],
    'uuid' => '',
    'title' => '',
    'weight' => '',
    'field_name' => '',
    'column' => '',
    'error_message' => '',
  ];
  $this->configuration = $configuration['data'] + $this
    ->defaultConfiguration();
  $this->uuid = $configuration['uuid'];
  $this->title = $configuration['title'];
  $this->weight = $configuration['weight'];
  $this->field_name = $configuration['field_name'];
  $this->column = $configuration['column'];
  $this->error_message = $configuration['error_message'];
  return $this;
}