You are here

function hook_field_inheritance_inheritance_class_alter in Field Inheritance 2.0.x

Same name and namespace in other branches
  1. 8 field_inheritance.api.php \hook_field_inheritance_inheritance_class_alter()

Alter the inheritance class used to build the inherited basefield.

The class to alter. @var Drupal\Core\Field\FieldDefinitionInterface $field The field context.

File

./field_inheritance.api.php, line 16
Custom hooks exposed by the field_inheritance module.

Code

function hook_field_inheritance_inheritance_class_alter(&$class, $field) {
  if ($field
    ->plugin() === 'entity_reference_inheritance') {
    $class = '\\Drupal\\my_module\\EntityReferenceFieldInheritanceFactory';
  }
}