You are here

public function ExtendedFieldComparatorObserver::update in Changed Fields API 8.3

Same name and namespace in other branches
  1. 8 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()

File

examples/changed_fields_extended_field_comparator/src/ExtendedFieldComparatorObserver.php, line 77

Class

ExtendedFieldComparatorObserver
Implementation of an example observer.

Namespace

Drupal\changed_fields_extended_field_comparator

Code

public function update(\SplSubject $entity_subject) {
  $entity = $entity_subject
    ->getEntity();
  $changed_fields = $entity_subject
    ->getChangedFields();

  // Do something with $entity depends on $changed_fields.
}