You are here

class BasicUsageObserver 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
  2. 7 examples/changed_fields_basic_usage/includes/changed_fields_basic_usage.observer.inc \BasicUsageObserver

Class BasicUsageObserver.

Hierarchy

Expanded class hierarchy of BasicUsageObserver

File

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

View source
class BasicUsageObserver extends CFObserver {

  /**
   * {@inheritdoc}
   */
  public function update(CFSubjectInterface $nodeSubject) {
    $node = $nodeSubject
      ->getNode();
    $changedFields = $nodeSubject
      ->getChangedFields();

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

}

Members

Namesort descending Modifiers Type Description Overrides
BasicUsageObserver::update public function Update method with info about event. Overrides CFObserver::update
CFObserver::$id private property Observer unique identifier.
CFObserver::getId public function Method to get observer id. Overrides CFObserverInterface::getId
CFObserver::__construct public function Observer constructor.