You are here

final class PathDeleteEvent in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/path_event_dispatcher/src/Event/Path/PathDeleteEvent.php \Drupal\path_event_dispatcher\Event\Path\PathDeleteEvent

Class PathDeleteEvent.

Hierarchy

Expanded class hierarchy of PathDeleteEvent

1 file declares its use of PathDeleteEvent
path_event_dispatcher.module in modules/path_event_dispatcher/path_event_dispatcher.module
Path event dispatcher submodule.

File

modules/path_event_dispatcher/src/Event/Path/PathDeleteEvent.php, line 10

Namespace

Drupal\path_event_dispatcher\Event\Path
View source
final class PathDeleteEvent extends AbstractPathEvent {

  /**
   * The redirect.
   *
   * @var bool
   */
  private $redirect;

  /**
   * Constructor.
   *
   * @param array $path
   *   The array structure is identical to that of the return value of
   *   \Drupal\Core\Path\AliasStorageInterface::save().
   */
  public function __construct(array $path) {
    parent::__construct($path);
    $this->redirect = $path['redirect'] ?? FALSE;
  }

  /**
   * Getter.
   *
   * @return bool
   *   If it's a redirect.
   */
  public function isRedirect() : bool {
    return $this->redirect;
  }

  /**
   * Get the dispatcher type.
   *
   * @return string
   *   The dispatcher type.
   */
  public function getDispatcherType() : string {
    return HookEventDispatcherInterface::PATH_DELETE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractPathEvent::$alias private property The alias for the source.
AbstractPathEvent::$langcode private property Lang code.
AbstractPathEvent::$pid private property The path id.
AbstractPathEvent::$source private property The source like '/node/1'.
AbstractPathEvent::getAlias public function Getter.
AbstractPathEvent::getLangcode public function Getter.
AbstractPathEvent::getPid public function Getter.
AbstractPathEvent::getSource public function Getter.
PathDeleteEvent::$redirect private property The redirect.
PathDeleteEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
PathDeleteEvent::isRedirect public function Getter.
PathDeleteEvent::__construct public function Constructor. Overrides AbstractPathEvent::__construct