5 * Hooks and documentation related to diff module.
9 * @defgroup diff Diff API
12 * Diff module provides a new plugin type, which determines how entity fields
13 * are mapped into strings which are then compared by the Diff component.
15 * Field diff builders are plugins annotated with class
16 * \Drupal\diff\Annotation\FieldDiffBuilder, and implement plugin interface
17 * \Drupal\diff\FieldDiffBuilderInterface. Field diff builders plugins are
18 * managed by the \Drupal\diff\DiffBuilderManager class. Field diff builders
19 * classes usually extend base class \Drupal\diff\FieldDiffBuilderBase and need
20 * to be in the namespace \Drupal\{your_module}\Plugin\diff\Field\. See the
21 * @link plugin_api Plugin API topic @endlink for more information on how to
24 * @} End of "defgroup diff".
33 * Alter the information provided in \Drupal\diff\Annotation\FieldDiffBuilder.
35 * @param array $diff_builders
36 * The array of field diff builders plugins, keyed on the machine-readable
39 function hook_field_diff_builder_info_alter(array &$diff_builders) {
40 // Set a new label for the text_field_diff_builder plugin
41 // instead of the one provided in the annotation.
42 $diff_builders['text_field_diff_builder']['label'] = t('New label');
46 * Alter the information provided in \Drupal\diff\Annotation\DiffLayoutBuilder.
48 * @param array $diff_layouts
49 * The array of diff layout builders plugins, keyed on the machine-readable
52 function hook_diff_layout_builder_info_alter(array &$diff_layouts) {
53 // Set a new label for the text_field_diff_builder plugin
54 // instead of the one provided in the annotation.
55 $diff_layouts['my_layout']['label'] = t('New label');
59 * @} End of "addtogroup hooks".