resolveSubtype()
The concrete class an incoming payload belongs to, for a union parent.
public
static resolveSubtype(array<string, mixed> $attributes) : Part>
Tagged unions resolve on their discriminator. The handful Telegram leaves
untagged (InputMessageContent, and the rest), and any payload whose tag
this build does not recognise - a member added to the Bot API since it was
generated - resolve instead to the subtype whose attributes the payload
matches most closely.
Parameters
-
$attributes
: array<string, mixed>
-
-
throws
-
PartException
When the part is not a union, or nothing matches.
setRawAttribute()
Writes straight to the attribute bag, skipping the `set{Key}Attribute` hook
and any cast. For use *inside* a mutator, which would otherwise have no way
to store its shaped value without recursing through {@see setAttribute()}.
protected
setRawAttribute(string $key, mixed $value) : void
Parameters
-
$key
: string
-
-
$value
: mixed
-