WorkOS PHP SDK

User
in package
implements JsonSerializable uses JsonSerializableTrait

Read onlyYes

The user object.

Table of Contents

Interfaces

JsonSerializable

Properties

$createdAt  : DateTimeImmutable
An ISO 8601 timestamp.
$email  : string
The email address of the user.
$emailVerified  : bool
Whether the user's email has been verified.
$externalId  : string|null
The external ID of the user.
$firstName  : string|null
The first name of the user.
$id  : string
The unique ID of the user.
$lastName  : string|null
The last name of the user.
$lastSignInAt  : DateTimeImmutable|null
The timestamp when the user last signed in.
$locale  : string|null
The user's preferred locale.
$metadata  : array<string, string>|null
Object containing metadata key/value pairs associated with the user.
$object  : string
Distinguishes the user object.
$profilePictureUrl  : string|null
A URL reference to an image representing the user.
$updatedAt  : DateTimeImmutable
An ISO 8601 timestamp.

Methods

__construct()  : mixed
fromArray()  : self
jsonSerialize()  : array<string|int, mixed>
toArray()  : array<string|int, mixed>

Properties

$createdAt

An ISO 8601 timestamp.

public DateTimeImmutable $createdAt

$email

The email address of the user.

public string $email

$emailVerified

Whether the user's email has been verified.

public bool $emailVerified

$externalId

The external ID of the user.

public string|null $externalId

$firstName

The first name of the user.

public string|null $firstName

$id

The unique ID of the user.

public string $id

$lastName

The last name of the user.

public string|null $lastName

$lastSignInAt

The timestamp when the user last signed in.

public DateTimeImmutable|null $lastSignInAt

$locale

The user's preferred locale.

public string|null $locale = null

$metadata

Object containing metadata key/value pairs associated with the user.

public array<string, string>|null $metadata = null

$object

Distinguishes the user object.

public string $object

$profilePictureUrl

A URL reference to an image representing the user.

public string|null $profilePictureUrl

$updatedAt

An ISO 8601 timestamp.

public DateTimeImmutable $updatedAt

Methods

__construct()

public __construct(string $object, string $id, string|null $firstName, string|null $lastName, string|null $profilePictureUrl, string $email, bool $emailVerified, string|null $externalId, DateTimeImmutable|null $lastSignInAt, DateTimeImmutable $createdAt, DateTimeImmutable $updatedAt[, array<string|int, mixed>|null $metadata = null ][, string|null $locale = null ]) : mixed
Parameters
$object : string
$id : string
$firstName : string|null
$lastName : string|null
$profilePictureUrl : string|null
$email : string
$emailVerified : bool
$externalId : string|null
$lastSignInAt : DateTimeImmutable|null
$createdAt : DateTimeImmutable
$updatedAt : DateTimeImmutable
$metadata : array<string|int, mixed>|null = null
$locale : string|null = null

fromArray()

public static fromArray(array<string|int, mixed> $data) : self
Parameters
$data : array<string|int, mixed>
Return values
self

jsonSerialize()

public jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

toArray()

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results