Same name in other branches
  1. 8.x-2.x src/FieldStateBase.php \Drupal\field_states_ui\FieldStateBase::setConfiguration()
2 calls to FieldStateBase::setConfiguration()
FieldStateBase::submitConfigurationForm dans src/FieldStateBase.php
FieldStateBase::__construct dans src/FieldStateBase.php

Fichier

src/FieldStateBase.php, line 127

Classe

FieldStateBase
Provides a base class for field staes.

Namespace

Drupal\field_states_ui

Code

public function setConfiguration(array $configuration) {
    $configuration += [
        'data' => [],
        'uuid' => '',
    ];
    $this->configuration = $configuration['data'] + $this->defaultConfiguration();
    if (!$this->configuration['value']) {
        $this->configuration['value'] = TRUE;
    }
    $this->uuid = $configuration['uuid'] ? $configuration['uuid'] : \Drupal::service('uuid')->generate();
    return $this;
}