hook_event_dispatcher-8.x-2.04/modules/core_event_dispatcher/src/Event/Entity/EntityUpdateEvent.php

modules/core_event_dispatcher/src/Event/Entity/EntityUpdateEvent.php
<?php

namespace Drupal\core_event_dispatcher\Event\Entity;

use Drupal\Core\Entity\EntityInterface;
use Drupal\core_event_dispatcher\EntityHookEvents;
use Drupal\hook_event_dispatcher\Attribute\HookEvent;

/**
 * Class EntityUpdateEvent.
 */
#[HookEvent(id: 'entity_update', hook: 'entity_update')]
class EntityUpdateEvent extends AbstractEntityEvent {

  /**
   * Get the original Entity.
   *
   * @return \Drupal\Core\Entity\EntityInterface|null
   *   The original entity.
   *
   * @see hook_entity_update()
   */
  public function getOriginalEntity(): ?EntityInterface {
    return $this->entity->original ?? NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function getDispatcherType(): string {
    return EntityHookEvents::ENTITY_UPDATE;
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc