You are here

interface MessengerInterface in Service Container 7.2

Same name and namespace in other branches
  1. 8 src/Messenger/MessengerInterface.php \Drupal\service_container\Messenger\MessengerInterface
  2. 7 src/Messenger/MessengerInterface.php \Drupal\service_container\Messenger\MessengerInterface

Hierarchy

Expanded class hierarchy of MessengerInterface

All classes that implement MessengerInterface

4 files declare their use of MessengerInterface
Plugin4A.php in modules/providers/service_container_annotation_discovery/tests/modules/service_container_annotation_discovery_test/src/Plugin/Plugin4/Plugin4A/Plugin4A.php
Plugin5A.php in modules/providers/service_container_annotation_discovery/tests/modules/service_container_annotation_discovery_test/src/Plugin/Plugin5/Plugin5A/Plugin5A.php
Plugin8A.php in modules/providers/service_container_annotation_discovery/tests/modules/service_container_annotation_discovery_subtest/src/Plugin/Plugin8/Plugin8A/Plugin8A.php
ServiceContainerAnnotationDiscoveryIntegrationTest.php in modules/providers/service_container_annotation_discovery/lib/Drupal/service_container_annotation_discovery/Tests/ServiceContainerAnnotationDiscoveryIntegrationTest.php
Contains \Drupal\service_container_annotation_discovery\Tests\ServiceContainerBlockIntegrationTest.

File

src/Messenger/MessengerInterface.php, line 10
Contains \Drupal\Core\Messenger\MessengerInterface.

Namespace

Drupal\service_container\Messenger
View source
interface MessengerInterface {

  /**
   * A status message.
   */
  const STATUS = 'status';

  /**
   * A warning.
   */
  const WARNING = 'warning';

  /**
   * An error.
   */
  const ERROR = 'error';

  /**
   * Adds a new message to the queue.
   *
   * @param string $message
   *   (optional) The translated message to be displayed to the user. For
   *   consistency with other messages, it should begin with a capital letter
   *   and end with a period.
   * @param string $type
   *   (optional) The message's type. Either self::STATUS, self::WARNING, or
   *   self::ERROR.
   * @param bool $repeat
   *   (optional) If this is FALSE and the message is already set, then the
   *   message won't be repeated. Defaults to FALSE.
   *
   * @return $this
   */
  public function addMessage($message, $type = self::STATUS, $repeat = FALSE);

  /**
   * Gets all messages.
   *
   * @return array[]
   *   Keys are message types and values are indexed arrays of messages. Message
   *   types are either self::STATUS, self::WARNING, or self::ERROR.
   */
  public function getMessages();

  /**
   * Gets all messages of a certain type.
   *
   * @param string $type
   *   The messages' type. Either self::STATUS, self::WARNING, or self::ERROR.
   *
   * @return string[]
   */
  public function getMessagesByType($type);

  /**
   * Deletes all messages.
   *
   * @return $this
   */
  public function deleteMessages();

  /**
   * Deletes all messages of a certain type.
   *
   * @param string $type
   *   The messages' type. Either self::STATUS, self::WARNING, or self::ERROR.
   *
   * @return $this
   */
  public function deleteMessagesByType($type);

}

Members

Namesort descending Modifiers Type Description Overrides
MessengerInterface::addMessage public function Adds a new message to the queue. 1
MessengerInterface::deleteMessages public function Deletes all messages. 1
MessengerInterface::deleteMessagesByType public function Deletes all messages of a certain type. 1
MessengerInterface::ERROR constant An error.
MessengerInterface::getMessages public function Gets all messages. 1
MessengerInterface::getMessagesByType public function Gets all messages of a certain type. 1
MessengerInterface::STATUS constant A status message.
MessengerInterface::WARNING constant A warning.