class HasTranslationEvent in Menu block current language 8
Translation event.
Hierarchy
- class \Drupal\menu_block_current_language\Event\HasTranslationEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of HasTranslationEvent
1 file declares its use of HasTranslationEvent
File
- src/
Event/ HasTranslationEvent.php, line 11
Namespace
Drupal\menu_block_current_language\EventView source
class HasTranslationEvent extends Event {
/**
* The menu link.
*
* @var \Drupal\Core\Menu\MenuLinkInterface
*/
protected $link;
/**
* Determines if menu link is visible.
*
* @var bool
*/
protected $status;
/**
* HasTranslationEvent constructor.
*
* @param \Drupal\Core\Menu\MenuLinkInterface $link
* The menu link.
* @param bool $status
* The visibility.
*/
public function __construct(MenuLinkInterface $link, $status) {
$this->link = $link;
$this->status = $status;
}
/**
* Determines if link should be visible or not.
*
* @return bool
* The visibility.
*/
public function hasTranslation() {
return $this->status;
}
/**
* Sets the visibility.
*
* @param bool $status
* The visibility.
*
* @return $this
*/
public function setHasTranslation($status) {
$this->status = (bool) $status;
return $this;
}
/**
* Gets the menu link.
*
* @return \Drupal\Core\Menu\MenuLinkInterface
* The menu link.
*/
public function getLink() {
return $this->link;
}
/**
* Sets the menu link.
*
* @param \Drupal\Core\Menu\MenuLinkInterface $menu_link
* The menu link.
*
* @return $this
*/
public function setLink(MenuLinkInterface $menu_link) {
$this->link = $menu_link;
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HasTranslationEvent:: |
protected | property | The menu link. | |
HasTranslationEvent:: |
protected | property | Determines if menu link is visible. | |
HasTranslationEvent:: |
public | function | Gets the menu link. | |
HasTranslationEvent:: |
public | function | Determines if link should be visible or not. | |
HasTranslationEvent:: |
public | function | Sets the visibility. | |
HasTranslationEvent:: |
public | function | Sets the menu link. | |
HasTranslationEvent:: |
public | function | HasTranslationEvent constructor. |