ApplicationIdentityProfileBuilder
extends Builder
in package
implements
JsonSerializable
Authors a complete replacement of game stats, or a username-only update.
Tags
Table of Contents
Interfaces
- JsonSerializable
Properties
Methods
- __get() : mixed
- Handles dynamic get calls onto the part.
- __isset() : bool
- Handles dynamic isset() and empty() calls onto the part.
- __set() : void
- Handles dynamic set calls onto the part.
- fromPart() : self
- Copies writable fields only; response metadata is not a PATCH parameter.
- getData() : array<string|int, mixed>|null
- getUsername() : string|null
- jsonSerialize() : array<string, mixed>
- new() : static
- omitData() : self
- Omit data so publishing changes only the username.
- publish() : PromiseInterface
- Publish through the existing identity repository; no additional profile repository.
- setData() : self
- Replace all stored stats. Null is preserved for existing array authoring parity.
- setUsername() : self
- Set the external username (maximum 1024 characters).
- checkForGetMutator() : string|false
- Checks if there is a get mutator present.
- checkForSetMutator() : string|false
- Checks if there is a set mutator present.
- getProperty() : mixed
- Gets a property on the parent part.
- setProperty() : void
- Sets an property on the parent part.
- studly() : string
- Converts a string to studlyCase.
Properties
$data
public
array<string|int, mixed>|null
$data
Complete profile data; omitted until explicitly set.
$username
public
string|null
$username
External username.
$payload
protected
array<string, mixed>
$payload
= []
Only explicitly supplied request fields.
Methods
__get()
Handles dynamic get calls onto the part.
public
__get(string $key) : mixed
Parameters
- $key : string
-
The attributes key.
Tags
Return values
mixed —The value of the attribute.
__isset()
Handles dynamic isset() and empty() calls onto the part.
public
__isset(string $key) : bool
A property is set when reading it yields a non-null value, which is the
contract ?? already has: only properties with a get mutator can be set.
Parameters
- $key : string
-
The attributes key.
Tags
Return values
bool —Whether reading the property yields a non-null value.
__set()
Handles dynamic set calls onto the part.
public
__set(string $key, mixed $value) : void
Parameters
- $key : string
-
The attributes key.
- $value : mixed
-
The attributes value.
Tags
fromPart()
Copies writable fields only; response metadata is not a PATCH parameter.
public
static fromPart(Part $part) : self
Nullable response fields and absent fields remain distinct.
Parameters
- $part : Part
-
An ApplicationIdentityProfile.
Return values
selfgetData()
public
getData() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetUsername()
public
getUsername() : string|null
Return values
string|nulljsonSerialize()
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>new()
public
static new() : static
Return values
staticomitData()
Omit data so publishing changes only the username.
public
omitData() : self
Return values
selfpublish()
Publish through the existing identity repository; no additional profile repository.
public
publish(ApplicationIdentityRepository $repository, User|string $user, string $provider_issued_user_id) : PromiseInterface
Parameters
- $repository : ApplicationIdentityRepository
-
Application identities.
- $user : User|string
-
Discord user.
- $provider_issued_user_id : string
-
External account ID.
Return values
PromiseInterfacesetData()
Replace all stored stats. Null is preserved for existing array authoring parity.
public
setData(array<string|int, mixed>|ProfileData|null $data) : self
Discord documents object writes; null response values are not a promised clearing operation.
Parameters
- $data : array<string|int, mixed>|ProfileData|null
-
The complete primary/dynamic data.
Return values
selfsetUsername()
Set the external username (maximum 1024 characters).
public
setUsername(?string $username) : self
Parameters
- $username : ?string
Return values
selfcheckForGetMutator()
Checks if there is a get mutator present.
protected
checkForGetMutator(string $key) : string|false
Parameters
- $key : string
-
The property name to check.
Return values
string|false —Either a string if it is a method or false.
checkForSetMutator()
Checks if there is a set mutator present.
protected
checkForSetMutator(string $key) : string|false
Parameters
- $key : string
-
The property name to check.
Return values
string|false —Either a string if it is a method or false.
getProperty()
Gets a property on the parent part.
protected
getProperty(string $key) : mixed
Parameters
- $key : string
-
The name of the property.
Tags
Return values
mixed —Either the property if it exists or void.
setProperty()
Sets an property on the parent part.
protected
setProperty(string $key, mixed $value) : void
Parameters
- $key : string
-
The name of the property.
- $value : mixed
-
The value of the property.
studly()
Converts a string to studlyCase.
private
static studly(string $string) : string
This is a port of updated Laravel's implementation, a non-regex with static cache. This method is private static as we may move it outside this class in future.
Parameters
- $string : string
-
The string to convert.