final class FossabotChannel extends FossabotDataModel implements FossabotChannel (View source)

Fossabot channel context data model. Contains information about the channel in which the custom API was invoked in.

Traits

Trait to consolidate the methods needs to implement the \Brandon14\FossabotCommander\Contracts\Stringable interface.

Trait to consolidate functionality of converting a class to JSON representation.

Properties

protected $data

Data model.

from  FossabotDataModel

Methods

string
toJson($options = 0)

{@inheritDoc}

__toString()

Magic method https://www.php.net/manual/en/language.oop5.magic.php#object. toString allows a class to decide how it will react when it is treated like a string.

string
toString()

{@inheritDoc}

bool
offsetExists(string $offset)

Whether an offset exists.

offsetGet(string $offset)

Offset to retrieve.

void
offsetSet(string $offset, mixed $value)

Offset to set.

void
offsetUnset(string $offset)

Offset to unset.

array
__serialize()

Serializes data.

void
__unserialize(array $data)

Unserializes data.

__get(string $name)

Gets property.

void
__set(string $name, mixed $value)

Sets property.

bool
__isset(string $name)

Checks for existence of property.

void
__unset(string $name)

Unsets property.

array
jsonSerialize()

Specify data which should be serialized to JSON.

toArray()

No description

createFromBody(array $body)

Creates a new Fossabot data model instance from a parsed array of API data.

string
id()

Channel ID.

string
login()

Channel log in name. This is the lowercase version of the broadcaster's username.

string
displayName()

The uppercased or internationalized version of the boradcaster's username.

string
avatarUrl()

URL to the user's profile avatar.

string
slug()

The fossabot channel URL of the broadcaster.

string
broadcasterType()

Broadcaster type (i.e. affiliate, partner, etc.).

string
provider()

Broadcaster provider (i.e. twitch, etc.).

string
providerId()

Provider ID.

createdAt()

Time the request was created at.

streamTimestamp()

Stream timestamp.

bool
isLive()

Whether channel is live or not currently.

Details

string toJson($options = 0)

{@inheritDoc}

Parameters

$options

Return Value

string

__toString()

Magic method https://www.php.net/manual/en/language.oop5.magic.php#object. toString allows a class to decide how it will react when it is treated like a string.

string toString()

{@inheritDoc}

Return Value

string

bool offsetExists(string $offset)

Whether an offset exists.

Parameters

string $offset

Offset name

Return Value

bool

offsetGet(string $offset)

Offset to retrieve.

Parameters

string $offset

Offset name

void offsetSet(string $offset, mixed $value)

Offset to set.

Parameters

string $offset

Offset name

mixed $value

Property value

Return Value

void

Exceptions

ImmutableDataModelException

void offsetUnset(string $offset)

Offset to unset.

Parameters

string $offset

Offset name

Return Value

void

Exceptions

ImmutableDataModelException

array __serialize()

Serializes data.

Return Value

array

void __unserialize(array $data)

Unserializes data.

Parameters

array $data

Unserialized data

Return Value

void

__get(string $name)

Gets property.

Parameters

string $name

Offset name

void __set(string $name, mixed $value)

Sets property.

Parameters

string $name

Offset name

mixed $value

Offset value

Return Value

void

Exceptions

ImmutableDataModelException

bool __isset(string $name)

Checks for existence of property.

Parameters

string $name

Offset name

Return Value

bool

void __unset(string $name)

Unsets property.

Parameters

string $name

Offset name

Return Value

void

Exceptions

ImmutableDataModelException

array jsonSerialize()

Specify data which should be serialized to JSON.

Return Value

array

toArray()

No description

static FossabotDataModel createFromBody(array $body)

Creates a new Fossabot data model instance from a parsed array of API data.

Parameters

array $body

Parsed API body

Return Value

FossabotDataModel

string id()

Channel ID.

Return Value

string

string login()

Channel log in name. This is the lowercase version of the broadcaster's username.

Return Value

string

string displayName()

The uppercased or internationalized version of the boradcaster's username.

Return Value

string

string avatarUrl()

URL to the user's profile avatar.

Return Value

string

string slug()

The fossabot channel URL of the broadcaster.

Return Value

string

string broadcasterType()

Broadcaster type (i.e. affiliate, partner, etc.).

Return Value

string

string provider()

Broadcaster provider (i.e. twitch, etc.).

Return Value

string

string providerId()

Provider ID.

Return Value

string

DateTimeImmutable createdAt()

Time the request was created at.

Return Value

DateTimeImmutable

DateTimeImmutable streamTimestamp()

Stream timestamp.

Return Value

DateTimeImmutable

bool isLive()

Whether channel is live or not currently.

Return Value

bool