DiscordPHP Documentation

ApplicationIdentityProfileBuilder extends Builder
in package
implements JsonSerializable

Authors a complete replacement of game stats, or a username-only update.

Tags
since
10.59.0
link
https://docs.discord.com/developers/resources/application-identity-profile#update-application-identity-profile

Table of Contents

Interfaces

JsonSerializable

Properties

$data  : array<string|int, mixed>|null
$username  : string|null
$payload  : array<string, mixed>

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

Methods

__get()

Handles dynamic get calls onto the part.

public __get(string $key) : mixed
Parameters
$key : string

The attributes key.

Tags
throws
Exception
see
self::getAttribute()

This function forwards onto getAttribute.

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
throws
Exception
see
self::getProperty()

This function forwards onto getProperty.

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
see
self::setAttribute()

This function forwards onto setAttribute.

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
self

setData()

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
self

setUsername()

Set the external username (maximum 1024 characters).

public setUsername(?string $username) : self
Parameters
$username : ?string
Return values
self

checkForGetMutator()

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
throws
Exception
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.

Tags
since
10.0.0
Return values
string
On this page

Search results