function hook_entity_field_info_alter

Alter defined entity properties.

Parameters

array $info: The property info array as returned by hook_entity_field_info().

string $entity_type: The entity type for which entity properties are defined.

See also

hook_entity_field_info()

Related topics

2 functions implement hook_entity_field_info_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

entity_reference_entity_field_info_alter in drupal/core/modules/entity_reference/entity_reference.module
Implements hook_entity_field_info_alter().
translation_entity_field_info_alter in drupal/core/modules/translation_entity/translation_entity.module
Implements hook_field_info_alter().

File

drupal/core/includes/entity.api.php, line 533
Hooks provided the Entity module.

Code

function hook_entity_field_info_alter(&$info, $entity_type) {
  if (!empty($info['definitions']['mymodule_text'])) {

    // Alter the mymodule_text property to use a custom class.
    $info['definitions']['mymodule_text']['class'] = '\\Drupal\\anothermodule\\EntityComputedText';
  }
}