You are here

public function EntityAdapter::onChange in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php \Drupal\Core\Entity\Plugin\DataType\EntityAdapter::onChange()

React to changes to a child property or item.

Note that this is invoked after any changes have been applied.

Parameters

$name: The name of the property or the delta of the list item which is changed.

Overrides TraversableTypedDataInterface::onChange

1 method overrides EntityAdapter::onChange()
ConfigEntityAdapter::onChange in core/lib/Drupal/Core/Entity/Plugin/DataType/ConfigEntityAdapter.php
React to changes to a child property or item.

File

core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php, line 135

Class

EntityAdapter
Defines the "entity" data type.

Namespace

Drupal\Core\Entity\Plugin\DataType

Code

public function onChange($property_name) {
  if (isset($this->entity) && $this->entity instanceof FieldableEntityInterface) {

    // Let the entity know of any changes.
    $this->entity
      ->onChange($property_name);
  }
}