public function ExampleEntityExtraFieldInfoSubscribers::fieldInfoAlter in Hook Event Dispatcher 8.2
Same name and namespace in other branches
- 3.x 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_dispatcherCode
public function fieldInfoAlter(EntityExtraFieldInfoAlterEvent $event) : void {
$fieldInfo =& $event
->getFieldInfo();
// Manipulate the field info.
$fieldInfo['node']['test']['display']['field_test']['weight'] = -20;
}