function TypedData::applyDefaultValue

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

Overrides TypedDataInterface::applyDefaultValue

3 methods override TypedData::applyDefaultValue()
EntityAdapter::applyDefaultValue in core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
Applies the default value.
FieldItemList::applyDefaultValue in core/lib/Drupal/Core/Field/FieldItemList.php
Applies the default value.
Map::applyDefaultValue in core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php
Applies the default value.

File

core/lib/Drupal/Core/TypedData/TypedData.php, line 138

Class

TypedData
The abstract base class for typed data.

Namespace

Drupal\Core\TypedData

Code

public function applyDefaultValue($notify = TRUE) {
    // Default to no default value.
    $this->setValue(NULL, $notify);
    return $this;
}

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