You are here

public function ExampleEntityExtraFieldInfoSubscribers::fieldInfoAlter in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 examples/ExampleEntityExtraFieldInfoSubscribers.php \Drupal\hook_event_dispatcher\ExampleEntityExtraFieldInfoSubscribers::fieldInfoAlter()

Entity extra field info.

Parameters

\Drupal\core_event_dispatcher\Event\Entity\EntityExtraFieldInfoAlterEvent $event: The event.

File

examples/ExampleEntityExtraFieldInfoSubscribers.php, line 51

Class

ExampleEntityExtraFieldInfoSubscribers
Class ExampleEntityExtraFieldInfoSubscribers.

Namespace

Drupal\hook_event_dispatcher

Code

public function fieldInfoAlter(EntityExtraFieldInfoAlterEvent $event) : void {
  $fieldInfo =& $event
    ->getFieldInfo();

  // Manipulate the field info.
  $fieldInfo['node']['test']['display']['field_test']['weight'] = -20;
}