class AuditLogEvent in Audit Log 8
Same name and namespace in other branches
- 8.2 src/AuditLogEvent.php \Drupal\audit_log\AuditLogEvent
Represents a single auditable event for logging.
@package Drupal\audit_log
Hierarchy
- class \Drupal\audit_log\AuditLogEvent implements AuditLogEventInterface
Expanded class hierarchy of AuditLogEvent
1 file declares its use of AuditLogEvent
- AuditLogEventTest.php in tests/
src/ Unit/ AuditLogEventTest.php
File
- src/
AuditLogEvent.php, line 13
Namespace
Drupal\audit_logView source
class AuditLogEvent implements AuditLogEventInterface {
/**
* The user that triggered the audit event.
*
* @var \Drupal\user\UserInterface
*/
protected $user;
/**
* The entity being modified.
*
* @var \Drupal\Core\Entity\EntityInterface
*/
protected $entity;
/**
* The audit message to write to the log.
*
* @var string
*/
protected $message;
/**
* Array of variables that match the message string replacement tokens.
*
* @var array
*/
protected $messagePlaceholders = [];
/**
* The type of event being reported.
*
* @var string
*/
protected $eventType;
/**
* The original state of the object before the event occurred.
*
* @var string
*/
protected $previousState;
/**
* The new state of the object after the event occurred.
*
* @var string
*/
protected $currentState;
/**
* Timestamp for when the event occurred.
*
* @var int
*/
protected $requestTime;
/**
* {@inheritdoc}
*/
public function setUser(AccountInterface $user) {
$this->user = $user;
return $this;
}
/**
* {@inheritdoc}
*/
public function setEntity(EntityInterface $entity) {
$this->entity = $entity;
return $this;
}
/**
* {@inheritdoc}
*/
public function setMessage($message) {
$this->message = $message;
return $this;
}
/**
* {@inheritdoc}
*/
public function setMessagePlaceholders($variables) {
$this->messagePlaceholders = $variables;
return $this;
}
/**
* {@inheritdoc}
*/
public function setEventType($event_type) {
$this->eventType = $event_type;
return $this;
}
/**
* {@inheritdoc}
*/
public function setPreviousState($state) {
$this->previousState = $state;
return $this;
}
/**
* {@inheritdoc}
*/
public function setCurrentState($state) {
$this->currentState = $state;
return $this;
}
/**
* {@inheritdoc}
*/
public function setRequestTime($request_time) {
$this->requestTime = $request_time;
return $this;
}
/**
* {@inheritdoc}
*/
public function getUser() {
return $this->user;
}
/**
* {@inheritdoc}
*/
public function getEntity() {
return $this->entity;
}
/**
* {@inheritdoc}
*/
public function getMessage() {
return $this->message;
}
/**
* {@inheritdoc}
*/
public function getMessagePlaceholders() {
return $this->messagePlaceholders;
}
/**
* {@inheritdoc}
*/
public function getEventType() {
return $this->eventType;
}
/**
* {@inheritdoc}
*/
public function getPreviousState() {
return $this->previousState;
}
/**
* {@inheritdoc}
*/
public function getCurrentState() {
return $this->currentState;
}
/**
* {@inheritdoc}
*/
public function getRequestTime() {
return $this->requestTime;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AuditLogEvent:: |
protected | property | The new state of the object after the event occurred. | |
AuditLogEvent:: |
protected | property | The entity being modified. | |
AuditLogEvent:: |
protected | property | The type of event being reported. | |
AuditLogEvent:: |
protected | property | The audit message to write to the log. | |
AuditLogEvent:: |
protected | property | Array of variables that match the message string replacement tokens. | |
AuditLogEvent:: |
protected | property | The original state of the object before the event occurred. | |
AuditLogEvent:: |
protected | property | Timestamp for when the event occurred. | |
AuditLogEvent:: |
protected | property | The user that triggered the audit event. | |
AuditLogEvent:: |
public | function |
Retrieves the new state of the object after the event occurred. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Retrieves the entity that was modified. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Retrieves the type of event that was triggered. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Retrieves the untranslated audit log message for the event. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Retrieves the replacement tokens for the log message. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Retrieves the original state of the object before the event occurred. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
The timestamp for when the event was initiated. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Retrieves the user object for the user that triggered the event. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Stores the new state of the object after the event occurred. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Stores the entity that triggered the audit event. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Stores the type of event being reported. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Stores the untranslated audit message to write to the log. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Stores the replacement tokens for the log message. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Stores the original state of the object before the event occurred. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Sets the timestamp for the event request. Overrides AuditLogEventInterface:: |
|
AuditLogEvent:: |
public | function |
Stores the user that triggers the audit event. Overrides AuditLogEventInterface:: |