You are here

public function PreviewLink::regenerateToken in Preview Link 8

Same name and namespace in other branches
  1. 2.x src/Entity/PreviewLink.php \Drupal\preview_link\Entity\PreviewLink::regenerateToken()
  2. 2.0.x src/Entity/PreviewLink.php \Drupal\preview_link\Entity\PreviewLink::regenerateToken()

Mark the entity needing a new token. Only updated upon save.

Parameters

bool $needs_new_token: Tell this entity to generate a new token.

Return value

bool TRUE if it was currently marked to generate otherwise FALSE.

Overrides PreviewLinkInterface::regenerateToken

File

src/Entity/PreviewLink.php, line 71

Class

PreviewLink
Defines the node entity class.

Namespace

Drupal\preview_link\Entity

Code

public function regenerateToken($needs_new_token = FALSE) {
  $current_value = $this->needsNewToken;
  $this->needsNewToken = $needs_new_token;
  return $current_value;
}