class BasicUsageObserver in Changed Fields API 8
Same name and namespace in other branches
- 8.3 examples/changed_fields_basic_usage/src/BasicUsageObserver.php \Drupal\changed_fields_basic_usage\BasicUsageObserver
- 8.2 examples/changed_fields_basic_usage/src/BasicUsageObserver.php \Drupal\changed_fields_basic_usage\BasicUsageObserver
Class BasicUsageObserver.
Hierarchy
- class \Drupal\changed_fields\Observer implements ObserverInterface
- class \Drupal\changed_fields_basic_usage\BasicUsageObserver
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_usageView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BasicUsageObserver:: |
public | function |
Update method with info about event. Overrides Observer:: |
|
Observer:: |
private | property | ||
Observer:: |
public | function |
Method to get observer id. Overrides ObserverInterface:: |
|
Observer:: |
public | function |