You are here

interface MessagePurgeInterface in Message 8

Interface for MessagePurge plugins.

Hierarchy

Expanded class hierarchy of MessagePurgeInterface

All classes that implement MessagePurgeInterface

2 files declare their use of MessagePurgeInterface
DaysTest.php in tests/src/Unit/Plugin/MessagePurge/DaysTest.php
message.module in ./message.module
API functions to manipulate messages.

File

src/MessagePurgeInterface.php, line 11

Namespace

Drupal\message
View source
interface MessagePurgeInterface extends ConfigurableInterface, PluginFormInterface {

  /**
   * The maximum number of messages that a queue worker should delete at once.
   */
  const MESSAGE_DELETE_SIZE = 100;

  /**
   * Fetch the messages that need to be purged for a given template.
   *
   * @param \Drupal\message\MessageTemplateInterface $template
   *   The message template to fetch messages for.
   *
   * @return array
   *   An array of \Drupal\message\MessageInterface entity IDs.
   */
  public function fetch(MessageTemplateInterface $template);

  /**
   * Process the purgeable messages.
   *
   * Normally this is a bulk delete operation.
   *
   * @param array $ids
   *   The message IDs to be processed.
   *
   * @return bool
   *   The result of the process.
   */
  public function process(array $ids);

  /**
   * Returns the purge method label.
   *
   * @return string
   *   The purge method label.
   */
  public function label();

  /**
   * Returns the purge method description.
   *
   * @return string
   *   The purge plugin description.
   */
  public function description();

  /**
   * Returns the weight of the purge plugin.
   *
   * @return int
   *   The integer weight of the purge plugin.
   */
  public function getWeight();

  /**
   * Sets the weight for this purge plugin.
   *
   * @param int $weight
   *   The weight for this purge plugin.
   *
   * @return $this
   */
  public function setWeight($weight);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
MessagePurgeInterface::description public function Returns the purge method description. 1
MessagePurgeInterface::fetch public function Fetch the messages that need to be purged for a given template. 2
MessagePurgeInterface::getWeight public function Returns the weight of the purge plugin. 1
MessagePurgeInterface::label public function Returns the purge method label. 1
MessagePurgeInterface::MESSAGE_DELETE_SIZE constant The maximum number of messages that a queue worker should delete at once.
MessagePurgeInterface::process public function Process the purgeable messages. 1
MessagePurgeInterface::setWeight public function Sets the weight for this purge plugin. 1
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18