You are here

abstract class AbstractPathEvent in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/path_event_dispatcher/src/Event/Path/AbstractPathEvent.php \Drupal\path_event_dispatcher\Event\Path\AbstractPathEvent

Class AbstractPathEvent.

Hierarchy

Expanded class hierarchy of AbstractPathEvent

File

modules/path_event_dispatcher/src/Event/Path/AbstractPathEvent.php, line 11

Namespace

Drupal\path_event_dispatcher\Event\Path
View source
abstract class AbstractPathEvent extends Event implements EventInterface {

  /**
   * The source like '/node/1'.
   *
   * @var string
   */
  private $source;

  /**
   * The alias for the source.
   *
   * @var string
   */
  private $alias;

  /**
   * Lang code.
   *
   * @var string
   */
  private $langcode;

  /**
   * The path id.
   *
   * @var int
   */
  private $pid;

  /**
   * AbstractPathEvent 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) {
    $this->source = $path['source'];
    $this->alias = $path['alias'];
    $this->langcode = $path['langcode'];
    $this->pid = (int) $path['pid'];
  }

  /**
   * Getter.
   *
   * @return int
   *   The path id.
   */
  public function getPid() : int {
    return $this->pid;
  }

  /**
   * Getter.
   *
   * @return string
   *   The source like '/node/1'.
   */
  public function getSource() : string {
    return $this->source;
  }

  /**
   * Getter.
   *
   * @return string
   *   The alias.
   */
  public function getAlias() : string {
    return $this->alias;
  }

  /**
   * Getter.
   *
   * @return string
   *   The langcode like 'nl'.
   */
  public function getLangcode() : string {
    return $this->langcode;
  }

}

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.
AbstractPathEvent::__construct public function AbstractPathEvent constructor. 1
EventInterface::getDispatcherType public function Get the dispatcher type. 75