Documentation

Message extends Part
in package

A message which is posted to a Discord text channel.

Table of Contents

ACTIVITY_JOIN  = 1
ACTIVITY_JOIN_REQUEST  = 4
ACTIVITY_LISTEN  = 3
ACTIVITY_SPECTATE  = 2
CHANNEL_FOLLOW_ADD  = 12
CHANNEL_PINNED_MESSAGE  = 6
GUILD_DISCOVERY_DISQUALIFIED  = 14
GUILD_DISCOVERY_REQUALIFIED  = 15
GUILD_MEMBER_JOIN  = 7
REACT_DELETE_ALL  = 0
REACT_DELETE_EMOJI  = 3
REACT_DELETE_ID  = 2
REACT_DELETE_ME  = 1
TYPE_APPLICATION_COMMAND  = 20
TYPE_CALL  = 3
TYPE_CHANNEL_ICON_CHANGE  = 5
TYPE_CHANNEL_NAME_CHANGE  = 4
TYPE_NORMAL  = 0
TYPE_REPLY  = 19
TYPE_USER_ADDED  = 1
TYPE_USER_REMOVED  = 2
USER_PREMIUM_GUILD_SUBSCRIPTION  = 8
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1  = 9
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2  = 10
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3  = 11
$activity  : object
$application  : object
$attachments  : array<string|int, mixed>
$author  : Member|User|null
$channel  : Channel|Thread|null
$channel_id  : string
$content  : string
$created  : bool
Is the part already created in the Discord servers?
$crossposted  : bool
$edited_timestamp  : Carbon|null
$embeds  : Collection|array<string|int, Embed>
$flags  : int
$guild  : Guild|null
$guild_id  : string
$id  : string
$interaction  : object|null
$is_crosspost  : bool
$link  : string|null
$member  : Member|null
$mention_channels  : Collection|array<string|int, Channel>
$mention_everyone  : bool
$mention_roles  : Collection|array<string|int, Role>
$mentions  : Collection|array<string|int, User>
$message_reference  : object
$nonce  : string|null
$pinned  : bool
$reactions  : ReactionRepository
$referenced_message  : Message|null
$scriptData  : mixed
Custom script data.
$source_message_deleted  : bool
$stickers  : Collection|array<string|int, Sticker>
$suppress_embeds  : bool
$thread  : Thread|null
$timestamp  : Carbon
$tts  : bool
$type  : int
$urgent  : bool
$user  : User|null
$user_id  : string
$webhook_id  : string
$attributes  : array<string|int, mixed>
The parts attributes.
$discord  : Discord
The Discord client.
$factory  : Factory
The factory.
$fillable  : array<string|int, mixed>
The parts fillable attributes.
$fillAfterSave  : bool
Should we fill the part after saving?
$hidden  : array<string|int, mixed>
Attributes that are hidden from debug info.
$http  : Http
The HTTP client.
$regex  : string
The regex pattern to replace variables with.
$repositories  : array<string|int, mixed>
An array of repositories that can exist in a part.
$repositories_cache  : array<string|int, mixed>
An array of repositories.
$visible  : array<string|int, mixed>
Attributes which are visible from debug info.
__construct()  : mixed
Create a new part instance.
__debugInfo()  : array<string|int, mixed>
Handles debug calls from var_dump and similar functions.
__get()  : mixed
Handles dynamic get calls onto the part.
__set()  : mixed
Handles dynamic set calls onto the part.
__toString()  : string
Converts the part to a string.
addEmbed()  : ExtendedPromiseInterface<string|int, Message>
Adds an embed to the message.
createReactionCollector()  : ExtendedPromiseInterface<string|int, Collection<string|int, MessageReaction>>
Creates a reaction collector for the message.
crosspost()  : ExtendedPromiseInterface<string|int, Message>
Crossposts the message to any following channels.
delayedDelete()  : ExtendedPromseInterface
Deletes the message after a delay.
delayedReply()  : ExtendedPromiseInterface<string|int, Message>
Replies to the message after a delay.
delete()  : ExtendedPromiseInterface
Deletes the message from the channel.
deleteReaction()  : ExtendedPromiseInterface
Deletes a reaction.
edit()  : ExtendedPromiseInterface<string|int, Message>
Edits the message.
fetch()  : ExtendedPromiseInterface<string|int, static>
Fetches any missing information about the part from Discord's servers.
fill()  : void
Fills the parts attributes from an array.
getCreatableAttributes()  : array<string|int, mixed>
Returns the attributes needed to create.
getLinkAttribute()  : string|null
Returns the message link attribute.
getPublicAttributes()  : array<string|int, mixed>
Returns an array of public attributes.
getRawAttributes()  : array<string|int, mixed>
Returns an array of raw attributes.
getRepositoryAttributes()  : array<string|int, mixed>
Gets the attributes to pass to repositories.
getUpdatableAttributes()  : array<string|int, mixed>
Returns the updatable attributes.
isPartial()  : bool
Whether the part is considered partial i.e. missing information which can be fetched from Discord.
jsonSerialize()  : array<string|int, mixed>
Provides data when the part is encoded into JSON. Used for JsonSerializable.
offsetExists()  : bool
Checks if an attribute exists via key. Used for ArrayAccess.
offsetGet()  : mixed
Gets an attribute via key. Used for ArrayAccess.
offsetSet()  : mixed
Sets an attribute via key. Used for ArrayAccess.
offsetUnset()  : mixed
Unsets an attribute via key. Used for ArrayAccess.
react()  : ExtendedPromiseInterface
Reacts to the message.
reply()  : ExtendedPromiseInterface<string|int, Message>
Replies to the message.
serialize()  : string
Serializes the data. Used for Serializable.
startThread()  : ExtendedPromiseInterface<string|int, Thread>
Starts a public thread from the message.
unserialize()  : mixed
Unserializes some data and stores it. Used for Serializable.
afterConstruct()  : void
Called after the part has been constructed.
getAuthorAttribute()  : User|Member|null
Returns the author attribute.
getChannelAttribute()  : Channel|Thread
Returns the channel attribute.
getCrosspostedAttribute()  : bool
Gets the crossposted attribute.
getEditedTimestampAttribute()  : Carbon|null
Returns the edited_timestamp attribute.
getEmbedsAttribute()  : Collection|array<string|int, Embed>
Returns the embed attribute.
getGuildAttribute()  : Guild|null
Returns the guild which the channel that the message was sent in belongs to.
getIsCrosspostAttribute()  : bool
Gets the is_crosspost attribute.
getMemberAttribute()  : Member|null
Returns the member attribute.
getMentionChannelsAttribute()  : Collection|array<string|int, Channel>
Gets the mention_channels attribute.
getMentionRolesAttribute()  : Collection
Returns the mention_roles attribute.
getMentionsAttribute()  : Collection
Returns the mention attribute.
getReferencedMessageAttribute()  : Message|null
Gets the referenced message attribute, if present.
getSourceMessageDeletedAttribute()  : bool
Gets the source_message_deleted attribute.
getStickersAttribute()  : array<string|int, Sticker>|Collection
Returns the stickers attribute.
getSuppressEmbedsAttribute()  : bool
Gets the suppress_embeds attribute.
getThreadAttribute()  : Thread|null
Returns the thread which the message was sent in.
getTimestampAttribute()  : Carbon|null
Returns the timestamp attribute.
getUrgentAttribute()  : bool
Gets the urgent attribute.
getUserAttribute()  : User|null
Returns the user attribute.
getUserIdAttribute()  : string
Returns the `user_id` attribute.
setReactionsAttribute()  : mixed
Sets the reactions attriubte.
_edit()  : ExtendedPromiseInterface
checkForMutator()  : string|false
Checks if there is a mutator present.
getAttribute()  : mixed
Gets an attribute on the part.
setAttribute()  : void
Sets an attribute on the part.

Constants

ACTIVITY_JOIN

public mixed ACTIVITY_JOIN = 1

ACTIVITY_JOIN_REQUEST

public mixed ACTIVITY_JOIN_REQUEST = 4

ACTIVITY_LISTEN

public mixed ACTIVITY_LISTEN = 3

ACTIVITY_SPECTATE

public mixed ACTIVITY_SPECTATE = 2

CHANNEL_FOLLOW_ADD

public mixed CHANNEL_FOLLOW_ADD = 12

CHANNEL_PINNED_MESSAGE

public mixed CHANNEL_PINNED_MESSAGE = 6

GUILD_DISCOVERY_DISQUALIFIED

public mixed GUILD_DISCOVERY_DISQUALIFIED = 14

GUILD_DISCOVERY_REQUALIFIED

public mixed GUILD_DISCOVERY_REQUALIFIED = 15

GUILD_MEMBER_JOIN

public mixed GUILD_MEMBER_JOIN = 7

REACT_DELETE_ALL

public mixed REACT_DELETE_ALL = 0

REACT_DELETE_EMOJI

public mixed REACT_DELETE_EMOJI = 3

REACT_DELETE_ID

public mixed REACT_DELETE_ID = 2

REACT_DELETE_ME

public mixed REACT_DELETE_ME = 1

TYPE_APPLICATION_COMMAND

public mixed TYPE_APPLICATION_COMMAND = 20

TYPE_CALL

public mixed TYPE_CALL = 3

TYPE_CHANNEL_ICON_CHANGE

public mixed TYPE_CHANNEL_ICON_CHANGE = 5

TYPE_CHANNEL_NAME_CHANGE

public mixed TYPE_CHANNEL_NAME_CHANGE = 4

TYPE_NORMAL

public mixed TYPE_NORMAL = 0

TYPE_REPLY

public mixed TYPE_REPLY = 19

TYPE_USER_ADDED

public mixed TYPE_USER_ADDED = 1

TYPE_USER_REMOVED

public mixed TYPE_USER_REMOVED = 2

USER_PREMIUM_GUILD_SUBSCRIPTION

public mixed USER_PREMIUM_GUILD_SUBSCRIPTION = 8

USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1

public mixed USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1 = 9

USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2

public mixed USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2 = 10

USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3

public mixed USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3 = 11

Properties

$activity

public object $activity

Current message activity. Requires rich presence.

$application

public object $application

Application of message. Requires rich presence.

$attachments

public array<string|int, mixed> $attachments

An array of attachment objects.

$channel_id

public string $channel_id

The unique identifier of the channel that the message was went in.

$content

public string $content

The content of the message if it is a normal message.

$created

Is the part already created in the Discord servers?

public bool $created = false

Whether the part has been created.

$crossposted

public bool $crossposted

Message has been crossposted.

$edited_timestamp

public Carbon|null $edited_timestamp

A timestamp of when the message was edited, or null.

$flags

public int $flags

Message flags.

$guild

public Guild|null $guild

The guild that the message was sent in.

$guild_id

public string $guild_id

The unique identifier of the guild that the channel the message was sent in belongs to.

$id

public string $id

The unique identifier of the message.

$interaction

public object|null $interaction

The interaction which triggered the message (slash commands).

$is_crosspost

public bool $is_crosspost

Message is a crosspost from another channel.

public string|null $link

Returns a link to the message.

$member

public Member|null $member

The member that sent this message, or null if it was in a private message.

$mention_everyone

public bool $mention_everyone

Whether the message contained an @everyone mention.

$mention_roles

public Collection|array<string|int, Role> $mention_roles

A collection of roles that were mentioned in the message.

$mentions

public Collection|array<string|int, User> $mentions

A collection of the users mentioned in the message.

$message_reference

public object $message_reference

Message that is referenced by this message.

$nonce

public string|null $nonce

A randomly generated string that provides verification for the client. Not required.

$pinned

public bool $pinned

Whether the message is pinned to the channel.

$referenced_message

public Message|null $referenced_message

The message that is referenced in a reply.

$scriptData

Custom script data.

public mixed $scriptData

Used for storing custom information, used by end products.

$source_message_deleted

public bool $source_message_deleted

Source message for this message has been deleted.

$suppress_embeds

public bool $suppress_embeds

Do not include embeds when serializing message.

$thread

public Thread|null $thread

The thread that the message was sent in.

$timestamp

public Carbon $timestamp

A timestamp of when the message was sent.

$tts

public bool $tts

Whether the message was sent as a text-to-speech message.

$type

public int $type

The type of message.

$urgent

public bool $urgent

Message is urgent.

$user

public User|null $user

The user that sent this message. Will be a webhook if sent from one.

$user_id

public string $user_id

The user id of the author.

$webhook_id

public string $webhook_id

ID of the webhook that made the message, if any.

$attributes

The parts attributes.

protected array<string|int, mixed> $attributes = []

The parts attributes and content.

$discord

The Discord client.

protected Discord $discord

Client.

$fillable

The parts fillable attributes.

protected array<string|int, mixed> $fillable = ['id', 'channel_id', 'guild_id', 'content', 'type', 'mentions', 'author', 'member', 'mention_everyone', 'timestamp', 'edited_timestamp', 'tts', 'attachments', 'embeds', 'nonce', 'mention_roles', 'pinned', 'mention_channels', 'reactions', 'webhook_id', 'activity', 'application', 'message_reference', 'referenced_message', 'flags', 'stickers', 'interaction']

The array of attributes that can be mass-assigned.

Tags
inheritdoc

$fillAfterSave

Should we fill the part after saving?

protected bool $fillAfterSave = true

Whether the part will be saved after being filled.

$hidden

Attributes that are hidden from debug info.

protected array<string|int, mixed> $hidden = []

Attributes that are hidden from public.

$http

The HTTP client.

protected Http $http

Client.

$regex

The regex pattern to replace variables with.

protected string $regex = '/:([a-z_]+)/'

The regex which is used to replace placeholders.

$repositories

An array of repositories that can exist in a part.

protected array<string|int, mixed> $repositories = ['reactions' => DiscordRepositoryChannelReactionRepository::class]

Repositories.

Tags
inheritdoc

$repositories_cache

An array of repositories.

protected array<string|int, mixed> $repositories_cache = []

$visible

Attributes which are visible from debug info.

protected array<string|int, mixed> $visible = []

Methods

__construct()

Create a new part instance.

public __construct(Discord $discord[, array<string|int, mixed> $attributes = [] ][, bool $created = false ]) : mixed
Parameters
$discord : Discord

The Discord client.

$attributes : array<string|int, mixed> = []

An array of attributes to build the part.

$created : bool = false

Whether the part has already been created.

Return values
mixed

__debugInfo()

Handles debug calls from var_dump and similar functions.

public __debugInfo() : array<string|int, mixed>
Tags
throws
Exception
see
self::getPublicAttributes()

This function forwards onto getPublicAttributes.

Return values
array<string|int, mixed>

An array of public attributes.

__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.

__set()

Handles dynamic set calls onto the part.

public __set(string $key, mixed $value) : mixed
Parameters
$key : string

The attributes key.

$value : mixed

The attributes value.

Tags
see
self::setAttribute()

This function forwards onto setAttribute.

Return values
mixed

__toString()

Converts the part to a string.

public __toString() : string
Tags
throws
Exception
see
self::getPublicAttributes()

This function encodes getPublicAttributes into JSON.

Return values
string

A JSON string of attributes.

addEmbed()

Adds an embed to the message.

public addEmbed(Embed $embed) : ExtendedPromiseInterface<string|int, Message>
Parameters
$embed : Embed
Return values
ExtendedPromiseInterface<string|int, Message>

createReactionCollector()

Creates a reaction collector for the message.

public createReactionCollector(callable $filter[, array<string|int, mixed> $options = [] ]) : ExtendedPromiseInterface<string|int, Collection<string|int, MessageReaction>>
Parameters
$filter : callable

The filter function. Returns true or false.

$options : array<string|int, mixed> = []
Return values
ExtendedPromiseInterface<string|int, Collection<string|int, MessageReaction>>

crosspost()

Crossposts the message to any following channels.

public crosspost() : ExtendedPromiseInterface<string|int, Message>
Return values
ExtendedPromiseInterface<string|int, Message>

delayedDelete()

Deletes the message after a delay.

public delayedDelete(int $delay) : ExtendedPromseInterface
Parameters
$delay : int

Time to delay the delete by, in milliseconds.

Return values
ExtendedPromseInterface

delayedReply()

Replies to the message after a delay.

public delayedReply(string $text, int $delay) : ExtendedPromiseInterface<string|int, Message>
Parameters
$text : string

Text to send after delay.

$delay : int

Delay after text will be sent in milliseconds.

Return values
ExtendedPromiseInterface<string|int, Message>

delete()

Deletes the message from the channel.

public delete() : ExtendedPromiseInterface
Return values
ExtendedPromiseInterface

deleteReaction()

Deletes a reaction.

public deleteReaction(int $type[, Emoji|string|null $emoticon = null ][, string|null $id = null ]) : ExtendedPromiseInterface
Parameters
$type : int

The type of deletion to perform.

$emoticon : Emoji|string|null = null

The emoticon to delete (if not all).

$id : string|null = null

The user reaction to delete (if not all).

Return values
ExtendedPromiseInterface

edit()

Edits the message.

public edit(MessageBuilder $message) : ExtendedPromiseInterface<string|int, Message>
Parameters
$message : MessageBuilder

Contains the new contents of the message. Note that fields not specified in the builder will not be overwritten.

Return values
ExtendedPromiseInterface<string|int, Message>

fetch()

Fetches any missing information about the part from Discord's servers.

public fetch() : ExtendedPromiseInterface<string|int, static>
Tags
throws
RuntimeException

The part is not fetchable.

Return values
ExtendedPromiseInterface<string|int, static>

fill()

Fills the parts attributes from an array.

public fill(array<string|int, mixed> $attributes) : void
Parameters
$attributes : array<string|int, mixed>

An array of attributes to build the part.

Return values
void

getCreatableAttributes()

Returns the attributes needed to create.

public getCreatableAttributes() : array<string|int, mixed>
Tags
inheritdoc
Return values
array<string|int, mixed>

getLinkAttribute()

Returns the message link attribute.

public getLinkAttribute() : string|null
Return values
string|null

getPublicAttributes()

Returns an array of public attributes.

public getPublicAttributes() : array<string|int, mixed>
Tags
throws
Exception
Return values
array<string|int, mixed>

An array of public attributes.

getRawAttributes()

Returns an array of raw attributes.

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

Raw attributes.

getRepositoryAttributes()

Gets the attributes to pass to repositories.

public getRepositoryAttributes() : array<string|int, mixed>
Tags
inheritdoc
Return values
array<string|int, mixed>

Attributes.

getUpdatableAttributes()

Returns the updatable attributes.

public getUpdatableAttributes() : array<string|int, mixed>
Tags
inheritdoc
Return values
array<string|int, mixed>

isPartial()

Whether the part is considered partial i.e. missing information which can be fetched from Discord.

public isPartial() : bool
Return values
bool

jsonSerialize()

Provides data when the part is encoded into JSON. Used for JsonSerializable.

public jsonSerialize() : array<string|int, mixed>
Tags
throws
Exception
see
self::getPublicAttributes()

This function forwards onto getPublicAttributes.

Return values
array<string|int, mixed>

An array of public attributes.

offsetExists()

Checks if an attribute exists via key. Used for ArrayAccess.

public offsetExists(string $key) : bool
Parameters
$key : string

The attribute key.

Return values
bool

Whether the offset exists.

offsetGet()

Gets an attribute via key. Used for ArrayAccess.

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

The attribute key.

Tags
throws
Exception
see
self::getAttribute()

This function forwards onto getAttribute.

Return values
mixed

offsetSet()

Sets an attribute via key. Used for ArrayAccess.

public offsetSet(string $key, mixed $value) : mixed
Parameters
$key : string

The attribute key.

$value : mixed

The attribute value.

Tags
see
self::setAttribute()

This function forwards onto setAttribute.

Return values
mixed

offsetUnset()

Unsets an attribute via key. Used for ArrayAccess.

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

The attribute key.

Return values
mixed

react()

Reacts to the message.

public react(Emoji|string $emoticon) : ExtendedPromiseInterface
Parameters
$emoticon : Emoji|string

The emoticon to react with. (custom: ':michael:251127796439449631')

Return values
ExtendedPromiseInterface

reply()

Replies to the message.

public reply(string $text) : ExtendedPromiseInterface<string|int, Message>
Parameters
$text : string

The text to reply with.

Return values
ExtendedPromiseInterface<string|int, Message>

serialize()

Serializes the data. Used for Serializable.

public serialize() : string
Return values
string

A string of serialized data.

startThread()

Starts a public thread from the message.

public startThread(string $name[, int $auto_archive_duration = 1440 ]) : ExtendedPromiseInterface<string|int, Thread>
Parameters
$name : string

The name of the thread.

$auto_archive_duration : int = 1440

Number of minutes of inactivity until the thread is auto-archived. One of 60, 1440, 4320, 10080.

Return values
ExtendedPromiseInterface<string|int, Thread>

unserialize()

Unserializes some data and stores it. Used for Serializable.

public unserialize(string $data) : mixed
Parameters
$data : string

Some serialized data.

Tags
see
self::setAttribute()

The unserialized data is stored with setAttribute.

Return values
mixed

afterConstruct()

Called after the part has been constructed.

protected afterConstruct() : void
Return values
void

getAuthorAttribute()

Returns the author attribute.

protected getAuthorAttribute() : User|Member|null
Tags
deprecated
6.0.0

Use Message::member or Message:user instead.

Return values
User|Member|null

The member that sent the message. Will return a User object if it is a PM.

getChannelAttribute()

Returns the channel attribute.

protected getChannelAttribute() : Channel|Thread
Return values
Channel|Thread

The channel or thread the message was sent in.

getCrosspostedAttribute()

Gets the crossposted attribute.

protected getCrosspostedAttribute() : bool
Return values
bool

getEditedTimestampAttribute()

Returns the edited_timestamp attribute.

protected getEditedTimestampAttribute() : Carbon|null
Return values
Carbon|null

The time that the message was edited.

getEmbedsAttribute()

Returns the embed attribute.

protected getEmbedsAttribute() : Collection|array<string|int, Embed>
Return values
Collection|array<string|int, Embed>

A collection of embeds.

getGuildAttribute()

Returns the guild which the channel that the message was sent in belongs to.

protected getGuildAttribute() : Guild|null
Return values
Guild|null

getIsCrosspostAttribute()

Gets the is_crosspost attribute.

protected getIsCrosspostAttribute() : bool
Return values
bool

getMemberAttribute()

Returns the member attribute.

protected getMemberAttribute() : Member|null
Return values
Member|null

The member that sent the message, or null if it was in a private message.

getMentionRolesAttribute()

Returns the mention_roles attribute.

protected getMentionRolesAttribute() : Collection
Return values
Collection

The roles that were mentioned.

getMentionsAttribute()

Returns the mention attribute.

protected getMentionsAttribute() : Collection
Return values
Collection

The users that were mentioned.

getReferencedMessageAttribute()

Gets the referenced message attribute, if present.

protected getReferencedMessageAttribute() : Message|null
Return values
Message|null

getSourceMessageDeletedAttribute()

Gets the source_message_deleted attribute.

protected getSourceMessageDeletedAttribute() : bool
Return values
bool

getSuppressEmbedsAttribute()

Gets the suppress_embeds attribute.

protected getSuppressEmbedsAttribute() : bool
Return values
bool

getThreadAttribute()

Returns the thread which the message was sent in.

protected getThreadAttribute() : Thread|null
Return values
Thread|null

getTimestampAttribute()

Returns the timestamp attribute.

protected getTimestampAttribute() : Carbon|null
Return values
Carbon|null

The time that the message was sent.

getUrgentAttribute()

Gets the urgent attribute.

protected getUrgentAttribute() : bool
Return values
bool

getUserAttribute()

Returns the user attribute.

protected getUserAttribute() : User|null
Return values
User|null

The user that sent the message. Can also be a webhook.

getUserIdAttribute()

Returns the `user_id` attribute.

protected getUserIdAttribute() : string
Return values
string

setReactionsAttribute()

Sets the reactions attriubte.

protected setReactionsAttribute(iteratable<string|int, mixed> $reactions) : mixed
Parameters
$reactions : iteratable<string|int, mixed>
Return values
mixed

checkForMutator()

Checks if there is a mutator present.

private checkForMutator(string $key, string $type) : string|false
Parameters
$key : string

The attribute name to check.

$type : string

Either get or set.

Return values
string|false

Either a string if it is callable or false.

getAttribute()

Gets an attribute on the part.

private getAttribute(string $key) : mixed
Parameters
$key : string

The key to the attribute.

Tags
throws
Exception
Return values
mixed

Either the attribute if it exists or void.

setAttribute()

Sets an attribute on the part.

private setAttribute(string $key, mixed $value) : void
Parameters
$key : string

The key to the attribute.

$value : mixed

The value of the attribute.

Return values
void

Search results