You are here

public function BasicUsageObserver::getInfo in Changed Fields API 8.3

Same name and namespace in other branches
  1. 8.2 examples/changed_fields_basic_usage/src/BasicUsageObserver.php \Drupal\changed_fields_basic_usage\BasicUsageObserver::getInfo()

Returns info for field comparator plugins.

Info is an associative array of entity types with their bundles and fields for watching.

Return value

array Array of entity types/bundles with field names for watching.

Overrides ObserverInterface::getInfo

File

examples/changed_fields_basic_usage/src/BasicUsageObserver.php, line 15

Class

BasicUsageObserver
Implementation of an example observer.

Namespace

Drupal\changed_fields_basic_usage

Code

public function getInfo() {
  return [
    'node' => [
      'article' => [
        'title',
        'body',
      ],
    ],
    'user' => [
      'user' => [
        'name',
        'mail',
      ],
    ],
    'taxonomy_term' => [
      'tags' => [
        'name',
        'description',
      ],
    ],
    'comment' => [
      'comment' => [
        'subject',
        'comment_body',
      ],
    ],
    'shortcut' => [
      'default' => [
        'title',
        'link',
      ],
    ],
    'menu_link_content' => [
      'menu_link_content' => [
        'title',
        'link',
      ],
    ],
    'media' => [
      'image' => [
        'name',
        'field_media_image',
      ],
    ],
    'block_content' => [
      'basic' => [
        'info',
        'body',
      ],
    ],
    'aggregator_feed' => [
      'aggregator_feed' => [
        'title',
        'refresh',
      ],
    ],
  ];
}