You are here

public function TokenAuthUser::enforceIsNew in Simple OAuth (OAuth2) & OpenID Connect 8.4

Same name and namespace in other branches
  1. 8 src/Authentication/TokenAuthUser.php \Drupal\simple_oauth\Authentication\TokenAuthUser::enforceIsNew()
  2. 8.2 src/Authentication/TokenAuthUser.php \Drupal\simple_oauth\Authentication\TokenAuthUser::enforceIsNew()
  3. 8.3 src/Authentication/TokenAuthUser.php \Drupal\simple_oauth\Authentication\TokenAuthUser::enforceIsNew()
  4. 5.x src/Authentication/TokenAuthUser.php \Drupal\simple_oauth\Authentication\TokenAuthUser::enforceIsNew()

Enforces an entity to be new.

Allows migrations to create entities with pre-defined IDs by forcing the entity to be new before saving.

Parameters

bool $value: (optional) Whether the entity should be forced to be new. Defaults to TRUE.

Return value

$this

Overrides EntityInterface::enforceIsNew

See also

\Drupal\Core\Entity\EntityInterface::isNew()

File

src/Authentication/TokenAuthUser.php, line 286

Class

TokenAuthUser
The decorated user class with token information.

Namespace

Drupal\simple_oauth\Authentication

Code

public function enforceIsNew($value = TRUE) {
  return $this->subject
    ->enforceIsNew($value);
}