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() {
|
||||
return [
|
||||
HookEventDispatcherInterface::ENTITY_INSERT => 'entityInsertOrUpdate',
|
||||
HookEventDispatcherInterface::ENTITY_UPDATE => 'entityInsertOrUpdate',
|
||||
HookEventDispatcherInterface::ENTITY_PRE_SAVE => 'onEntityPreSave',
|
||||
];
|
||||
}
|
||||
|
||||
public function entityInsertOrUpdate(BaseEntityEvent $event): void {
|
||||
public function onEntityPreSave(BaseEntityEvent $event): void {
|
||||
if ($event->getEntity()->getEntityTypeId() != 'node') {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue