Documentation

ReactionRepository extends AbstractRepository

Contains invites on a message.

Tags
see
Message
see
Reaction

Table of Contents

$class  : mixed
{@inheritdoc}
$discrim  : string
The collection discriminator.
$endpoints  : array<string|int, mixed>
Endpoints for interacting with the Discord servers.
$factory  : Factory
The parts factory.
$http  : Http
The HTTP client.
$items  : array<string|int, mixed>
The items contained in the collection.
$vars  : array<string|int, mixed>
Variables that are related to the repository.
__construct()  : mixed
Create a new collection.
__debugInfo()  : array<string|int, mixed>
Returns an item that will be displayed for debugging.
clear()  : void
Clears the collection.
count()  : int
Counts the amount of objects in the collection.
create()  : Part
Builds a new, empty part.
delete()  : ExtendedPromiseInterface
Attempts to delete a part on the Discord servers.
fetch()  : ExtendedPromiseInterface
Gets a part from the repository or Discord servers.
fill()  : Collection
Fills an array of items into the collection.
filter()  : Collection
Runs a filter callback over the collection and returns a new collection based on the response of the callback.
find()  : mixed
Runs a filter callback over the collection and returns the first item where the callback returns `true` when given the item.
first()  : mixed
Returns the first element of the collection.
for()  : Collection
Creates a collection for a class.
fresh()  : ExtendedPromiseInterface
Returns a part with fresh values.
freshen()  : ExtendedPromiseInterface
Freshens the repository collection.
from()  : Collection
Creates a collection from an array.
get()  : mixed
Gets an item from the collection.
getIterator()  : Traversable
Returns an iterator for the collection.
has()  : bool
Checks if the array has an object.
isset()  : bool
If the collection has an offset.
jsonSerialize()  : array<string|int, mixed>
Serializes the object to a value that can be serialized natively by json_encode().
map()  : Collection
Runs a callback over the collection and creates a new collection.
offsetExists()  : bool
If the collection has an offset.
offsetGet()  : mixed
Gets an item from the collection.
offsetSet()  : void
Sets an item into the collection.
offsetUnset()  : void
Unsets an index from the collection.
pull()  : mixed
Pulls an item from the collection.
push()  : Collection
Pushes items to the collection.
pushItem()  : Collection
Pushes a single item to the collection.
save()  : ExtendedPromiseInterface
Attempts to save a part to the Discord servers.
serialize()  : string
Returns the string representation of the collection.
set()  : mixed
Sets a value in the collection.
toArray()  : array<string|int, mixed>
Converts the collection to an array.
unserialize()  : void
Unserializes the collection.

Properties

$class

{@inheritdoc}

protected mixed $class = DiscordPartsChannelReaction::class

$discrim

The collection discriminator.

protected string $discrim

$endpoints

Endpoints for interacting with the Discord servers.

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

$items

The items contained in the collection.

protected array<string|int, mixed> $items

$vars

Variables that are related to the repository.

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

Methods

__construct()

Create a new collection.

public __construct([mixed $items = [] ][, string $discrim = 'id' ][, string|null $class = null ]) : mixed
Parameters
$items : mixed = []
$discrim : string = 'id'
$class : string|null = null
Return values
mixed

__debugInfo()

Returns an item that will be displayed for debugging.

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

clear()

Clears the collection.

public clear() : void
Return values
void

count()

Counts the amount of objects in the collection.

public count() : int
Return values
int

create()

Builds a new, empty part.

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

The attributes for the new part.

$created : bool = false
Tags
throws
Exception
Return values
Part

The new part.

delete()

Attempts to delete a part on the Discord servers.

public delete(Part|snowflake $part) : ExtendedPromiseInterface
Parameters
$part : Part|snowflake

The part to delete.

Tags
throws
Exception
Return values
ExtendedPromiseInterface

fetch()

Gets a part from the repository or Discord servers.

public fetch(string $id[, bool $fresh = false ]) : ExtendedPromiseInterface
Parameters
$id : string

The ID to search for.

$fresh : bool = false

Whether we should skip checking the cache.

Tags
throws
Exception
Return values
ExtendedPromiseInterface

fill()

Fills an array of items into the collection.

public fill(array<string|int, mixed> $items) : Collection
Parameters
$items : array<string|int, mixed>
Return values
Collection

filter()

Runs a filter callback over the collection and returns a new collection based on the response of the callback.

public filter(callable $callback) : Collection
Parameters
$callback : callable
Return values
Collection

find()

Runs a filter callback over the collection and returns the first item where the callback returns `true` when given the item.

public find(callable $callback) : mixed

Returns null if no items returns true when called in the callback.

Parameters
$callback : callable
Return values
mixed

first()

Returns the first element of the collection.

public first() : mixed
Return values
mixed

for()

Creates a collection for a class.

public static for(string $class[, string $discrim = 'id' ]) : Collection
Parameters
$class : string
$discrim : string = 'id'
Return values
Collection

fresh()

Returns a part with fresh values.

public fresh(Part $part) : ExtendedPromiseInterface
Parameters
$part : Part

The part to get fresh values.

Tags
throws
Exception
Return values
ExtendedPromiseInterface

freshen()

Freshens the repository collection.

public freshen() : ExtendedPromiseInterface
Tags
throws
Exception
Return values
ExtendedPromiseInterface

from()

Creates a collection from an array.

public static from([array<string|int, mixed> $items = [] ][, string $discrim = 'id' ][, string $class = null ]) : Collection
Parameters
$items : array<string|int, mixed> = []
$discrim : string = 'id'
$class : string = null
Return values
Collection

get()

Gets an item from the collection.

public get(string $discrim, mixed $key) : mixed
Parameters
$discrim : string
$key : mixed
Return values
mixed

getIterator()

Returns an iterator for the collection.

public getIterator() : Traversable
Return values
Traversable

has()

Checks if the array has an object.

public has(array<string|int, mixed> ...$keys) : bool
Parameters
$keys : array<string|int, mixed>
Return values
bool

isset()

If the collection has an offset.

public isset(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

jsonSerialize()

Serializes the object to a value that can be serialized natively by json_encode().

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

map()

Runs a callback over the collection and creates a new collection.

public map(callable $callback) : Collection
Parameters
$callback : callable
Return values
Collection

offsetExists()

If the collection has an offset.

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

Gets an item from the collection.

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed
Return values
mixed

offsetSet()

Sets an item into the collection.

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Return values
void

offsetUnset()

Unsets an index from the collection.

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed
Return values
void

pull()

Pulls an item from the collection.

public pull(mixed $key[, mixed $default = null ]) : mixed
Parameters
$key : mixed
$default : mixed = null
Return values
mixed

pushItem()

Pushes a single item to the collection.

public pushItem(mixed $item) : Collection
Parameters
$item : mixed
Return values
Collection

save()

Attempts to save a part to the Discord servers.

public save(Part $part) : ExtendedPromiseInterface
Parameters
$part : Part

The part to save.

Tags
throws
Exception
Return values
ExtendedPromiseInterface

serialize()

Returns the string representation of the collection.

public serialize() : string
Return values
string

set()

Sets a value in the collection.

public set(mixed $offset, mixed $value) : mixed
Parameters
$offset : mixed
$value : mixed
Return values
mixed

toArray()

Converts the collection to an array.

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

unserialize()

Unserializes the collection.

public unserialize(string $serialized) : void
Parameters
$serialized : string
Return values
void

Search results