You are here

public function TokenAuthUser::set in Simple OAuth (OAuth2) & OpenID Connect 8

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

Sets a field value.

Parameters

string $field_name: The name of the field to set; e.g., 'title' or 'name'.

mixed $value: The value to set, or NULL to unset the field.

bool $notify: (optional) Whether to notify the entity of the change. Defaults to TRUE. If the update stems from the entity, set it to FALSE to avoid being notified again.

Return value

$this

Throws

\InvalidArgumentException If the specified field does not exist.

Overrides FieldableEntityInterface::set

File

src/Authentication/TokenAuthUser.php, line 507

Class

TokenAuthUser
Class TokenAuthUser.

Namespace

Drupal\simple_oauth\Authentication

Code

public function set($field_name, $value, $notify = TRUE) {
  return $this->subject
    ->set($field_name, $value, $notify);
}