You are here

public function PersistentToken::__construct in Persistent Login 8

Construct a persistent token.

If a user id is not provided, the token is marked as not-validated.

Parameters

string $series: The long-lived identifier.

string $instance: The single-use identifier.

int $uid: The user id (optional).

File

src/PersistentToken.php, line 71

Class

PersistentToken
Class PersistentToken.

Namespace

Drupal\persistent_login

Code

public function __construct($series, $instance, $uid = self::STATUS_NOT_VALIDATED) {
  $this->series = $series;
  $this->instance = $instance;
  $this->uid = $uid;

  // Set the default creation date.
  // Existing tokens can update the value afterwards with setCreated().
  $this->created = $this->refreshed = new \DateTime();
}