class MessageUiContextualLinkEditMessage in Message UI 8
Contextual link to edit the message.
Plugin annotation
@MessageUiViewsContextualLinks(
id = "edit",
label = @Translation("Button the delete a message."),
weight = 1
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\message_ui\MessageUiViewsContextualLinksBase implements MessageUiViewsContextualLinksInterface
- class \Drupal\message_ui\Plugin\MessageUiViewsContextualLinks\MessageUiContextualLinkEditMessage implements ContainerFactoryPluginInterface, MessageUiViewsContextualLinksInterface
- class \Drupal\message_ui\MessageUiViewsContextualLinksBase implements MessageUiViewsContextualLinksInterface
Expanded class hierarchy of MessageUiContextualLinkEditMessage
File
- src/
Plugin/ MessageUiViewsContextualLinks/ MessageUiContextualLinkEditMessage.php, line 21
Namespace
Drupal\message_ui\Plugin\MessageUiViewsContextualLinksView source
class MessageUiContextualLinkEditMessage extends MessageUiViewsContextualLinksBase implements MessageUiViewsContextualLinksInterface, ContainerFactoryPluginInterface {
/**
* Drupal\Core\Entity\EntityTypeManagerInterface definition.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Construct.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param string $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager service.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('entity_type.manager'));
}
/**
* {@inheritdoc}
*/
public function access() {
return $this->message
->access('edit');
}
/**
* {@inheritdoc}
*/
public function getRouterInfo() {
return [
'title' => t('Edit'),
'url' => Url::fromRoute('entity.message.edit_form', [
'message' => $this->message
->id(),
]),
];
}
}