You are here

private function Incident::calculateHash in Radioactivity 8.3

Same name and namespace in other branches
  1. 8.2 src/Incident.php \Drupal\radioactivity\Incident::calculateHash()
  2. 4.0.x src/Incident.php \Drupal\radioactivity\Incident::calculateHash()

Calculate hash for this incident.

Return value

string The calculated hash of this incident.

2 calls to Incident::calculateHash()
Incident::isValid in src/Incident.php
Test validity of the Incident.
Incident::toJson in src/Incident.php
Convert to JSON format.

File

src/Incident.php, line 85

Class

Incident
Data class for Radioactivity Incident.

Namespace

Drupal\radioactivity

Code

private function calculateHash() {
  return sha1(implode('##', [
    $this->fieldName,
    $this->entityType,
    $this->entityId,
    $this->energy,
    Settings::getHashSalt(),
  ]));
}