function DataDefinition::setSettings

Same name in other branches
  1. 9 core/lib/Drupal/Core/TypedData/DataDefinition.php \Drupal\Core\TypedData\DataDefinition::setSettings()
  2. 10 core/lib/Drupal/Core/TypedData/DataDefinition.php \Drupal\Core\TypedData\DataDefinition::setSettings()
  3. 11.x core/lib/Drupal/Core/TypedData/DataDefinition.php \Drupal\Core\TypedData\DataDefinition::setSettings()

Sets the array of settings, as required by the used class.

Parameters

array $settings: The array of settings.

Return value

static The object itself for chaining.

2 methods override DataDefinition::setSettings()
BaseFieldDefinition::setSettings in core/lib/Drupal/Core/Field/BaseFieldDefinition.php
Note that the method does not unset existing settings not specified in the incoming $settings array.
FieldDefinition::setSettings in core/lib/Drupal/Core/Field/FieldDefinition.php
Sets the array of settings, as required by the used class.

File

core/lib/Drupal/Core/TypedData/DataDefinition.php, line 230

Class

DataDefinition
A typed data definition class for defining data based on defined data types.

Namespace

Drupal\Core\TypedData

Code

public function setSettings(array $settings) {
    $this->definition['settings'] = $settings;
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.