You are here

public function Map::applyDefaultValue in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php \Drupal\Core\TypedData\Plugin\DataType\Map::applyDefaultValue()
  2. 9 core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php \Drupal\Core\TypedData\Plugin\DataType\Map::applyDefaultValue()

Applies the default value.

Parameters

bool $notify: (optional) Whether to notify the parent object of the change. Defaults to TRUE. If a property is updated from a parent object, set it to FALSE to avoid being notified again.

Return value

$this Returns itself to allow for chaining.

Overrides TypedData::applyDefaultValue

1 call to Map::applyDefaultValue()
CreatedItem::applyDefaultValue in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/CreatedItem.php
Applies the default value.
4 methods override Map::applyDefaultValue()
CreatedItem::applyDefaultValue in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/CreatedItem.php
Applies the default value.
LanguageItem::applyDefaultValue in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
Applies the default value.
TextItemBase::applyDefaultValue in core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php
Applies the default value.
UuidItem::applyDefaultValue in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UuidItem.php
Applies the default value.

File

core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php, line 239

Class

Map
The "map" data type.

Namespace

Drupal\Core\TypedData\Plugin\DataType

Code

public function applyDefaultValue($notify = TRUE) {

  // Apply the default value of all properties.
  foreach ($this
    ->getProperties() as $property) {
    $property
      ->applyDefaultValue(FALSE);
  }
  return $this;
}