You are here

changed_fields_basic_usage.observer.inc in Changed Fields API 7.2

Observer example.

File

examples/changed_fields_basic_usage/includes/changed_fields_basic_usage.observer.inc
View source
<?php

/**
 * @file
 * Observer example.
 */

/**
 * Class BasicUsageObserver.
 */
class BasicUsageObserver extends CFObserver {

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

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

}

Classes

Namesort descending Description
BasicUsageObserver Class BasicUsageObserver.