2 * Implements hook_entity_bundle_field_info_alter().
4 function {{ machine_name }}_entity_bundle_field_info_alter(&$fields, \Drupal\Core\Entity\EntityTypeInterface $entity_type, $bundle) {
5 if ($entity_type->id() == 'node' && $bundle == 'article' && !empty($fields['mymodule_text'])) {
6 // Alter the mymodule_text field to use a custom class.
7 $fields['mymodule_text']->setClass('\Drupal\anothermodule\EntityComputedText');