Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||||
| DisplayBuilderEvents | n/a |
0 / 0 |
n/a |
0 / 0 |
n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Drupal\display_builder\Event; |
| 6 | |
| 7 | /** |
| 8 | * Defines events for the display builder. |
| 9 | * |
| 10 | * @see \Drupal\display_builder\Event\DisplayBuilderEvent |
| 11 | * @see \Drupal\display_builder\Island\IslandEventSubscriberInterface |
| 12 | */ |
| 13 | final class DisplayBuilderEvents { |
| 14 | |
| 15 | /** |
| 16 | * Fired when a node's source configuration is updated in-place. |
| 17 | */ |
| 18 | public const ON_UPDATE = 'onUpdate'; |
| 19 | |
| 20 | /** |
| 21 | * Fired when a new node is attached directly at root level. |
| 22 | */ |
| 23 | public const ON_ATTACH_TO_ROOT = 'onAttachToRoot'; |
| 24 | |
| 25 | /** |
| 26 | * Fired when a new node is attached into a component slot. |
| 27 | */ |
| 28 | public const ON_ATTACH_TO_SLOT = 'onAttachToSlot'; |
| 29 | |
| 30 | /** |
| 31 | * Fired when an existing node is moved (to root or into a slot). |
| 32 | */ |
| 33 | public const ON_MOVE = 'onMove'; |
| 34 | |
| 35 | /** |
| 36 | * Fired when a node becomes the active/focused node in the UI. |
| 37 | */ |
| 38 | public const ON_ACTIVE = 'onActive'; |
| 39 | |
| 40 | /** |
| 41 | * Fired when a node is removed from the tree. |
| 42 | */ |
| 43 | public const ON_DELETE = 'onDelete'; |
| 44 | |
| 45 | /** |
| 46 | * Fired when the history pointer changes (undo / redo). |
| 47 | */ |
| 48 | public const ON_HISTORY_CHANGE = 'onHistoryChange'; |
| 49 | |
| 50 | /** |
| 51 | * Fired when the builder is restored to its last saved state. |
| 52 | * |
| 53 | * Discards all unsaved changes since the last explicit save. |
| 54 | */ |
| 55 | public const ON_RESTORE = 'onRestore'; |
| 56 | |
| 57 | /** |
| 58 | * Fired when an entity view override is reverted to the base display config. |
| 59 | * |
| 60 | * Handled by display_builder_entity_view; clears the field override and |
| 61 | * reloads sources from the entity view display configuration. |
| 62 | */ |
| 63 | public const ON_REVERT = 'onRevert'; |
| 64 | |
| 65 | /** |
| 66 | * Fired when the builder state is saved to the backing config entity. |
| 67 | */ |
| 68 | public const ON_PUBLISH = 'onPublish'; |
| 69 | |
| 70 | /** |
| 71 | * Fired when a node is saved as a reusable preset. |
| 72 | */ |
| 73 | public const ON_PRESET_SAVE = 'onPresetSave'; |
| 74 | |
| 75 | } |