function hook_field_inheritance_inheritance_class_alter in Field Inheritance 8
Same name and namespace in other branches
- 2.0.x 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';
}
}