You are here

public function ExtendedFieldComparatorObserver::update in Changed Fields API 8

Same name and namespace in other branches
  1. 8.3 examples/changed_fields_extended_field_comparator/src/ExtendedFieldComparatorObserver.php \Drupal\changed_fields_extended_field_comparator\ExtendedFieldComparatorObserver::update()
  2. 8.2 examples/changed_fields_extended_field_comparator/src/ExtendedFieldComparatorObserver.php \Drupal\changed_fields_extended_field_comparator\ExtendedFieldComparatorObserver::update()

Update method with info about event.

It is called by NodeSubject when node fields have been changed.

Parameters

SubjectInterface $nodeSubject:

Overrides Observer::update

File

examples/changed_fields_extended_field_comparator/src/ExtendedFieldComparatorObserver.php, line 21
Contains ExtendedFieldComparatorObserver.php.

Class

ExtendedFieldComparatorObserver
Class ExtendedFieldComparatorObserver.

Namespace

Drupal\changed_fields_extended_field_comparator

Code

public function update(SubjectInterface $nodeSubject) {
  $node = $nodeSubject
    ->getNode();
  $changedFields = $nodeSubject
    ->getChangedFields();

  // Do something with $node depends on $changedFields.
}