You are here

interface IncidentStorageInterface in Radioactivity 4.0.x

Same name and namespace in other branches
  1. 8.3 src/IncidentStorageInterface.php \Drupal\radioactivity\IncidentStorageInterface

Defines the incident storage interface.

Hierarchy

Expanded class hierarchy of IncidentStorageInterface

All classes that implement IncidentStorageInterface

3 files declare their use of IncidentStorageInterface
DefaultIncidentStorageTest.php in tests/src/Unit/DefaultIncidentStorageTest.php
EmitControllerTest.php in tests/src/Unit/EmitControllerTest.php
RadioactivityProcessorTest.php in tests/src/Unit/RadioactivityProcessorTest.php

File

src/IncidentStorageInterface.php, line 8

Namespace

Drupal\radioactivity
View source
interface IncidentStorageInterface {

  /**
   * The key to identify the radioactivity incident storage.
   */
  const STORAGE_KEY = 'radioactivity_incidents';

  /**
   * Adds an incident to the storage.
   *
   * @param \Drupal\radioactivity\IncidentInterface $incident
   *   The incident object.
   */
  public function addIncident(IncidentInterface $incident);

  /**
   * Gets all incidents from the storage.
   *
   * @return \Drupal\radioactivity\IncidentInterface[]
   *   Array of incident objects.
   */
  public function getIncidents();

  /**
   * Gets all incidents from the storage per entity type.
   *
   * @param string $entity_type
   *   Entity type for selection. Default to all entity types.
   *
   * @return \Drupal\radioactivity\IncidentInterface[][]
   *   Array of incident objects keyed by entity type (1st) and entity ID (2nd).
   */
  public function getIncidentsByType($entity_type = '');

  /**
   * Clears the incident storage.
   */
  public function clearIncidents();

  /**
   * Add endpoint settings to the page.
   *
   * @param array $page
   *   Page attachments as provided by hook_page_attachments_alter().
   */
  public function injectSettings(array &$page);

}

Members

Namesort descending Modifiers Type Description Overrides
IncidentStorageInterface::addIncident public function Adds an incident to the storage. 2
IncidentStorageInterface::clearIncidents public function Clears the incident storage. 2
IncidentStorageInterface::getIncidents public function Gets all incidents from the storage. 2
IncidentStorageInterface::getIncidentsByType public function Gets all incidents from the storage per entity type. 2
IncidentStorageInterface::injectSettings public function Add endpoint settings to the page. 2
IncidentStorageInterface::STORAGE_KEY constant The key to identify the radioactivity incident storage.