function MessengerTrait::setMessenger

Same name in other branches
  1. 9 core/lib/Drupal/Core/Messenger/MessengerTrait.php \Drupal\Core\Messenger\MessengerTrait::setMessenger()
  2. 8.9.x core/lib/Drupal/Core/Messenger/MessengerTrait.php \Drupal\Core\Messenger\MessengerTrait::setMessenger()
  3. 10 core/lib/Drupal/Core/Messenger/MessengerTrait.php \Drupal\Core\Messenger\MessengerTrait::setMessenger()

Sets the messenger.

Parameters

\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger.

1 call to MessengerTrait::setMessenger()
LayoutBuilderDisableForm::__construct in core/modules/layout_builder/src/Form/LayoutBuilderDisableForm.php
Constructs a new RevertOverridesForm.

File

core/lib/Drupal/Core/Messenger/MessengerTrait.php, line 23

Class

MessengerTrait
Provides a trait for the messenger service.

Namespace

Drupal\Core\Messenger

Code

public function setMessenger(MessengerInterface $messenger) {
    $this->messenger = $messenger;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.