You are here

BasicUsageObserver.php in Changed Fields API 8

File

examples/changed_fields_basic_usage/src/BasicUsageObserver.php
View source
<?php

/**
 * @file
 * Contains BasicUsageObserver.php.
 */
namespace Drupal\changed_fields_basic_usage;

use Drupal\changed_fields\Observer;
use Drupal\changed_fields\SubjectInterface;

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

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

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

}

Classes

Namesort descending Description
BasicUsageObserver Class BasicUsageObserver.