You are here

abstract class BasePathEvent in Hook Event Dispatcher 8

Class BasePathEvent.

Hierarchy

  • class \Drupal\hook_event_dispatcher\Event\Path\BasePathEvent extends \Symfony\Component\EventDispatcher\Event implements EventInterface

Expanded class hierarchy of BasePathEvent

File

src/Event/Path/BasePathEvent.php, line 11

Namespace

Drupal\hook_event_dispatcher\Event\Path
View source
abstract class BasePathEvent extends Event implements EventInterface {

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

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

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

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

  /**
   * BaseEntityEvent constructor.
   *
   * @param array $fields
   *   The Entity.
   */
  public function __construct(array $fields) {
    $this->source = $fields['source'];
    $this->alias = $fields['alias'];
    $this->langcode = $fields['langcode'];
    $this->pid = (int) $fields['pid'];
  }

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

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

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

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

}

Members

Namesort descending Modifiers Type Description Overrides
BasePathEvent::$alias protected property The alias for the source.
BasePathEvent::$langcode protected property Lang code.
BasePathEvent::$pid protected property The path id.
BasePathEvent::$source protected property The source like '/node/1'.
BasePathEvent::getAlias public function Getter.
BasePathEvent::getLangcode public function Getter.
BasePathEvent::getPid public function Getter.
BasePathEvent::getSource public function Getter.
BasePathEvent::__construct public function BaseEntityEvent constructor. 1
EventInterface::getDispatcherType public function Get the dispatcher type. 66