You are here

public function BasicUsageObserver::update in Changed Fields API 7

Same name and namespace in other branches
  1. 7.3 examples/changed_fields_basic_usage/includes/changed_fields_basic_usage.observer.inc \BasicUsageObserver::update()
  2. 7.2 examples/changed_fields_basic_usage/includes/changed_fields_basic_usage.observer.inc \BasicUsageObserver::update()

Update method with info about event.

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

Parameters

CFNodeSubject $nodeSubject:

Overrides CFObserver::update

File

examples/changed_fields_basic_usage/includes/changed_fields_basic_usage.observer.inc, line 16
changed_fields_basic_usage.observer.inc file.

Class

BasicUsageObserver
Class BasicUsageObserver.

Code

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

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