Use a pre-save hook for updating the talk date
This commit is contained in:
parent
2632f09b7f
commit
f5767f7739
|
@ -18,12 +18,11 @@ final class UpdateTalkCreatedDateOnSave implements EventSubscriberInterface {
|
||||||
|
|
||||||
public static function getSubscribedEvents() {
|
public static function getSubscribedEvents() {
|
||||||
return [
|
return [
|
||||||
HookEventDispatcherInterface::ENTITY_INSERT => 'entityInsertOrUpdate',
|
HookEventDispatcherInterface::ENTITY_PRE_SAVE => 'onEntityPreSave',
|
||||||
HookEventDispatcherInterface::ENTITY_UPDATE => 'entityInsertOrUpdate',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function entityInsertOrUpdate(BaseEntityEvent $event): void {
|
public function onEntityPreSave(BaseEntityEvent $event): void {
|
||||||
if ($event->getEntity()->getEntityTypeId() != 'node') {
|
if ($event->getEntity()->getEntityTypeId() != 'node') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue