class Message in Entity Legal 8.2
Same name and namespace in other branches
- 4.0.x src/Plugin/EntityLegal/Message.php \Drupal\entity_legal\Plugin\EntityLegal\Message
- 3.0.x src/Plugin/EntityLegal/Message.php \Drupal\entity_legal\Plugin\EntityLegal\Message
Method class for alerting existing users via Drupal set message.
Plugin annotation
@EntityLegal(
id = "message",
label = @Translation("Drupal warning message, prompting the user, until accepted"),
type = "existing_users",
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\entity_legal\EntityLegalPluginBase implements EntityLegalPluginInterface
- class \Drupal\entity_legal\Plugin\EntityLegal\Message
- class \Drupal\entity_legal\EntityLegalPluginBase implements EntityLegalPluginInterface
Expanded class hierarchy of Message
File
- src/
Plugin/ EntityLegal/ Message.php, line 17
Namespace
Drupal\entity_legal\Plugin\EntityLegalView source
class Message extends EntityLegalPluginBase {
/**
* {@inheritdoc}
*/
public function execute(array &$context = []) {
/** @var \Drupal\entity_legal\EntityLegalDocumentInterface $document */
foreach ($this->documents as $document) {
$message = t('Please accept the @document_name.', [
'@document_name' => Link::createFromRoute($document
->getPublishedVersion()
->label(), 'entity.entity_legal_document.canonical', [
'entity_legal_document' => $document
->id(),
])
->toString(),
]);
drupal_set_message($message, 'warning', FALSE);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityLegalPluginBase:: |
protected | property | The legal documents that implement this plugin. | |
EntityLegalPluginBase:: |
public | function | Get all Entity Legal Documents for this plugin. | |
EntityLegalPluginBase:: |
public | function |
Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase:: |
1 |
Message:: |
public | function |
Execute callback for Entity Legal method plugin. Overrides EntityLegalPluginInterface:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. |