You are here

public function BasicUsageObserver::update in Changed Fields API 8.3

Same name and namespace in other branches
  1. 8 examples/changed_fields_basic_usage/src/BasicUsageObserver.php \Drupal\changed_fields_basic_usage\BasicUsageObserver::update()
  2. 8.2 examples/changed_fields_basic_usage/src/BasicUsageObserver.php \Drupal\changed_fields_basic_usage\BasicUsageObserver::update()

File

examples/changed_fields_basic_usage/src/BasicUsageObserver.php, line 77

Class

BasicUsageObserver
Implementation of an example observer.

Namespace

Drupal\changed_fields_basic_usage

Code

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

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