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

File

drupal/core/includes/entity.api.php, line 339
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';
  }
}