class LanguageSwitchLinksAlterEvent in Hook Event Dispatcher 8
Class LanguageSwitchLinksAlterEvent.
Hierarchy
- class \Drupal\hook_event_dispatcher\Event\Language\LanguageSwitchLinksAlterEvent extends \Symfony\Component\EventDispatcher\Event implements EventInterface
Expanded class hierarchy of LanguageSwitchLinksAlterEvent
2 files declare their use of LanguageSwitchLinksAlterEvent
- hook_event_dispatcher.module in ./
hook_event_dispatcher.module - Hook event dispatcher module.
- LanguageSwitchLinksAlterEventTest.php in tests/
src/ Unit/ Language/ LanguageSwitchLinksAlterEventTest.php
File
- src/
Event/ Language/ LanguageSwitchLinksAlterEvent.php, line 13
Namespace
Drupal\hook_event_dispatcher\Event\LanguageView source
class LanguageSwitchLinksAlterEvent extends Event implements EventInterface {
/**
* The links array.
*
* @var array
*/
private $links;
/**
* The language type.
*
* @var string
*/
private $type;
/**
* The request path.
*
* @var \Drupal\Core\Url
*/
private $path;
/**
* LanguageSwitchLinksAlterEvent constructor.
*
* @param array $links
* The links array.
* @param string $type
* The language type.
* @param \Drupal\Core\Url $path
* The request path.
*/
public function __construct(array &$links, $type, Url $path) {
$this->links =& $links;
$this->type = $type;
$this->path = $path;
}
/**
* Get the links array.
*
* @return array
* The links array.
*/
public function &getLinks() {
return $this->links;
}
/**
* Set the links.
*
* @param array $links
* The links array.
*/
public function setLinks(array $links) {
$this->links = $links;
}
/**
* Set the link for a specific language code.
*
* @param string $langcode
* The link language code.
* @param array $link
* The link path.
*/
public function setLinkForLanguage($langcode, array $link) {
$this->links[$langcode] = $link;
}
/**
* Get the language type.
*
* @return string
* The language type.
*/
public function getType() {
return $this->type;
}
/**
* Get the request path.
*
* @return \Drupal\Core\Url
* The link path.
*/
public function getPath() {
return $this->path;
}
/**
* {@inheritdoc}
*/
public function getDispatcherType() {
return HookEventDispatcherInterface::LANGUAGE_SWITCH_LINKS_ALTER;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LanguageSwitchLinksAlterEvent:: |
private | property | The links array. | |
LanguageSwitchLinksAlterEvent:: |
private | property | The request path. | |
LanguageSwitchLinksAlterEvent:: |
private | property | The language type. | |
LanguageSwitchLinksAlterEvent:: |
public | function |
Get the dispatcher type. Overrides EventInterface:: |
|
LanguageSwitchLinksAlterEvent:: |
public | function | Get the links array. | |
LanguageSwitchLinksAlterEvent:: |
public | function | Get the request path. | |
LanguageSwitchLinksAlterEvent:: |
public | function | Get the language type. | |
LanguageSwitchLinksAlterEvent:: |
public | function | Set the link for a specific language code. | |
LanguageSwitchLinksAlterEvent:: |
public | function | Set the links. | |
LanguageSwitchLinksAlterEvent:: |
public | function | LanguageSwitchLinksAlterEvent constructor. |