You are here

class BasicUsageObserver in Changed Fields API 8

Same name and namespace in other branches
  1. 8.3 examples/changed_fields_basic_usage/src/BasicUsageObserver.php \Drupal\changed_fields_basic_usage\BasicUsageObserver
  2. 8.2 examples/changed_fields_basic_usage/src/BasicUsageObserver.php \Drupal\changed_fields_basic_usage\BasicUsageObserver

Class BasicUsageObserver.

Hierarchy

Expanded class hierarchy of BasicUsageObserver

1 string reference to 'BasicUsageObserver'
changed_fields_basic_usage.services.yml in examples/changed_fields_basic_usage/changed_fields_basic_usage.services.yml
examples/changed_fields_basic_usage/changed_fields_basic_usage.services.yml
1 service uses BasicUsageObserver
changed_fields.observer in examples/changed_fields_basic_usage/changed_fields_basic_usage.services.yml
Drupal\changed_fields_basic_usage\BasicUsageObserver

File

examples/changed_fields_basic_usage/src/BasicUsageObserver.php, line 16
Contains BasicUsageObserver.php.

Namespace

Drupal\changed_fields_basic_usage
View source
class BasicUsageObserver extends Observer {

  /**
   * {@inheritdoc}
   */
  public function update(SubjectInterface $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 Observer::update
Observer::$id private property
Observer::getId public function Method to get observer id. Overrides ObserverInterface::getId
Observer::__construct public function