You are here

public function Subscription::getAccessHash in Mailing List 8

Calculates an access hash.

Return value

string The hash.

Overrides SubscriptionInterface::getAccessHash

File

src/Entity/Subscription.php, line 197

Class

Subscription
Defines the subscription entity class.

Namespace

Drupal\mailing_list\Entity

Code

public function getAccessHash() {
  $data = $this
    ->uuid() . $this
    ->getChangedTime() . $this
    ->getOwnerId();
  return Crypt::hmacBase64($data, \Drupal::service('private_key')
    ->get());
}