You are here

interface AuditLogEventInterface in Audit Log 8

Same name and namespace in other branches
  1. 8.2 src/AuditLogEventInterface.php \Drupal\audit_log\AuditLogEventInterface

Represents a single auditable event for logging.

@package Drupal\audit_log

Hierarchy

Expanded class hierarchy of AuditLogEventInterface

All classes that implement AuditLogEventInterface

5 files declare their use of AuditLogEventInterface
Database.php in src/StorageBackend/Database.php
EventSubscriberInterface.php in src/EventSubscriber/EventSubscriberInterface.php
Node.php in src/EventSubscriber/Node.php
StorageBackendInterface.php in src/StorageBackend/StorageBackendInterface.php
User.php in src/EventSubscriber/User.php

File

src/AuditLogEventInterface.php, line 13

Namespace

Drupal\audit_log
View source
interface AuditLogEventInterface {

  /**
   * Stores the user that triggers the audit event.
   *
   * @param \Drupal\Core\Session\AccountInterface $user
   *   The user object of the user performing an action to be logged.
   *
   * @return AuditLogEventInterface
   *   The current instance of the object.
   */
  public function setUser(AccountInterface $user);

  /**
   * Stores the entity that triggered the audit event.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity being modified.
   *
   * @return AuditLogEventInterface
   *   The current instance of the object.
   */
  public function setEntity(EntityInterface $entity);

  /**
   * Stores the untranslated audit message to write to the log.
   *
   * @param string $message
   *   The untranslated audit message.
   *
   * @return AuditLogEventInterface
   *   The current instance of the object.
   */
  public function setMessage($message);

  /**
   * Stores the replacement tokens for the log message.
   *
   * @param array $variables
   *   The array of replacement tokens.
   *
   * @return AuditLogEventInterface
   *   The current instance of the event.
   */
  public function setMessagePlaceholders($variables);

  /**
   * Stores the type of event being reported.
   *
   * @param string $event_type
   *   The type of event being reported.
   *   Example: "insert", "update", "delete".
   *
   * @return AuditLogEventInterface
   *   The current instance of the object.
   */
  public function setEventType($event_type);

  /**
   * Stores the original state of the object before the event occurred.
   *
   * @param string $state
   *   The name of the object state such as "published" or "active".
   *
   * @return AuditLogEventInterface
   *   The current instance of the object.
   */
  public function setPreviousState($state);

  /**
   * Stores the new state of the object after the event occurred.
   *
   * @param string $state
   *   The name of the object state such as "published" or "active".
   *
   * @return AuditLogEventInterface
   *   The current instance of the object.
   */
  public function setCurrentState($state);

  /**
   * Sets the timestamp for the event request.
   *
   * @param int $request_time
   *   The timestamp of the request.
   *
   * @return \Drupal\audit_log\AuditLogEventInterface
   *   The current instance of the object.
   */
  public function setRequestTime($request_time);

  /**
   * Retrieves the user object for the user that triggered the event.
   *
   * @return \Drupal\Core\Session\AccountInterface
   *   The user object for the user that triggered the event.
   */
  public function getUser();

  /**
   * Retrieves the entity that was modified.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   The entity that was modified.
   */
  public function getEntity();

  /**
   * Retrieves the untranslated audit log message for the event.
   *
   * @return string
   *   The untranslated audit log message.
   */
  public function getMessage();

  /**
   * Retrieves the replacement tokens for the log message.
   *
   * @return array
   *   The replacement tokens for the log message.
   */
  public function getMessagePlaceholders();

  /**
   * Retrieves the type of event that was triggered.
   *
   * @return string
   *   The type of event such as "insert", "update", "delete".
   */
  public function getEventType();

  /**
   * Retrieves the original state of the object before the event occurred.
   *
   * @return string
   *   The name of the object state such as "published" or "active".
   */
  public function getPreviousState();

  /**
   * Retrieves the new state of the object after the event occurred.
   *
   * @return string
   *   The name of the object state such as "published" or "active".
   */
  public function getCurrentState();

  /**
   * The timestamp for when the event was initiated.
   *
   * @return int
   */
  public function getRequestTime();

}

Members

Namesort descending Modifiers Type Description Overrides
AuditLogEventInterface::getCurrentState public function Retrieves the new state of the object after the event occurred. 1
AuditLogEventInterface::getEntity public function Retrieves the entity that was modified. 1
AuditLogEventInterface::getEventType public function Retrieves the type of event that was triggered. 1
AuditLogEventInterface::getMessage public function Retrieves the untranslated audit log message for the event. 1
AuditLogEventInterface::getMessagePlaceholders public function Retrieves the replacement tokens for the log message. 1
AuditLogEventInterface::getPreviousState public function Retrieves the original state of the object before the event occurred. 1
AuditLogEventInterface::getRequestTime public function The timestamp for when the event was initiated. 1
AuditLogEventInterface::getUser public function Retrieves the user object for the user that triggered the event. 1
AuditLogEventInterface::setCurrentState public function Stores the new state of the object after the event occurred. 1
AuditLogEventInterface::setEntity public function Stores the entity that triggered the audit event. 1
AuditLogEventInterface::setEventType public function Stores the type of event being reported. 1
AuditLogEventInterface::setMessage public function Stores the untranslated audit message to write to the log. 1
AuditLogEventInterface::setMessagePlaceholders public function Stores the replacement tokens for the log message. 1
AuditLogEventInterface::setPreviousState public function Stores the original state of the object before the event occurred. 1
AuditLogEventInterface::setRequestTime public function Sets the timestamp for the event request. 1
AuditLogEventInterface::setUser public function Stores the user that triggers the audit event. 1