You are here

public function BasicUsageObserver::update in Changed Fields API 7.2

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 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

CFSubjectInterface $nodeSubject: Node subject object.

Overrides CFObserver::update

File

examples/changed_fields_basic_usage/includes/changed_fields_basic_usage.observer.inc, line 16
Observer example.

Class

BasicUsageObserver
Class BasicUsageObserver.

Code

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

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