Skip to content
Snippets Groups Projects
Commit c055bf22 authored by Jürgen Haas's avatar Jürgen Haas
Browse files

Issue #3502470 by jurgenhaas: ECA Content: create bundle should provide some tokens

parent bc23900a
No related branches found
Tags 8.x-1.11
No related merge requests found
Pipeline #407026 canceled
......@@ -558,6 +558,27 @@ class ContentEntityEvent extends EventBase implements CleanupInterface {
new Token(name: 'ids', description: 'The IDs of the entities.'),
],
)]
#[Token(
name: 'event',
description: 'The event.',
classes: [
ContentEntityViewModeAlter::class,
],
properties: [
new Token(name: 'view_mode', description: 'The view mode machine name.'),
],
)]
#[Token(
name: 'event',
description: 'The event.',
classes: [
ContentEntityBaseBundle::class,
],
properties: [
new Token(name: 'entity_type_id', description: 'The entity type.'),
new Token(name: 'bundle', description: 'The bundle machine name.'),
],
)]
protected function buildEventData(): array {
$event = $this->event;
$data = [];
......@@ -573,6 +594,13 @@ class ContentEntityEvent extends EventBase implements CleanupInterface {
'view_mode' => $event->getViewMode(),
];
}
elseif ($event instanceof ContentEntityBaseBundle) {
$x = 1;
$data += [
'entity_type_id' => $event->getEntityTypeId(),
'bundle' => $event->getBundle(),
];
}
$data += parent::buildEventData();
return $data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment