class GuildMemberStorage extends Storage implements GuildMemberStorageInterface (View source)

Guild Member Storage to store guild members, utilizes Collection.

Properties

protected Client $client The client this storage belongs to. from Storage
protected array $baseStorageArgs Basic storage args. from Storage
protected Guild $guild The guild this storage belongs to.

Methods

__construct(Client $client, Guild $guild, array $data = null)

No description

bool
__isset(string $name)

No description

from Storage
string
__get(string $name)

No description

from Storage
bool
has(mixed $key)

Determines if a given key exists in the collection.

mixed|null
get(mixed $key)

Returns the item at a given key. If the key does not exist, null is returned.

$this
set(mixed $key, mixed $value)

Sets a key-value pair.

$this
delete(mixed $key)

Removes an item.

copy()

Returns a copy of itself. This does not make a copy of the stored data.

from Storage
filter(callable $closure)

Filters the storage by a given callback, keeping only those items that pass a given truth test. Returns a new Storage instance.

from Storage
sort(bool $descending = false, int $options = \SORT_REGULAR)

Sorts the collection. Returns a new Storage instance.

from Storage
Collection
sortKey(bool $descending = false, int $options = \SORT_REGULAR)

Sorts the collection by key. Returns a new Storage instance.

from Storage
Collection
sortCustom(callable $closure)

Sorts the collection using a custom sorting function. Returns a new Storage instance.

from Storage
Collection
sortCustomKey(callable $closure)

Sorts the collection by key using a custom sorting function. Returns a new Storage instance.

from Storage
resolve(GuildMember|User|string|int $guildmember)

Resolves given data to a guildmember.

factory(array $data)

Factory to create (or retrieve existing) guild members.

Details

__construct(Client $client, Guild $guild, array $data = null)

Parameters

Client $client
Guild $guild
array $data

bool __isset(string $name)

Parameters

string $name

Return Value

bool

Exceptions

Exception

string __get(string $name)

Parameters

string $name

Return Value

string

Exceptions

RuntimeException

bool has(mixed $key)

Determines if a given key exists in the collection.

Parameters

mixed $key

Return Value

bool

Exceptions

InvalidArgumentException

mixed|null get(mixed $key)

Returns the item at a given key. If the key does not exist, null is returned.

Parameters

mixed $key

Return Value

mixed|null

Exceptions

InvalidArgumentException

$this set(mixed $key, mixed $value)

Sets a key-value pair.

Parameters

mixed $key
mixed $value

Return Value

$this

Exceptions

InvalidArgumentException

$this delete(mixed $key)

Removes an item.

Parameters

mixed $key

Return Value

$this

StorageInterface copy()

Returns a copy of itself. This does not make a copy of the stored data.

Return Value

StorageInterface

StorageInterface filter(callable $closure)

Filters the storage by a given callback, keeping only those items that pass a given truth test. Returns a new Storage instance.

Parameters

callable $closure

Return Value

StorageInterface

StorageInterface sort(bool $descending = false, int $options = \SORT_REGULAR)

Sorts the collection. Returns a new Storage instance.

Parameters

bool $descending
int $options

Return Value

StorageInterface

Collection sortKey(bool $descending = false, int $options = \SORT_REGULAR)

Sorts the collection by key. Returns a new Storage instance.

Parameters

bool $descending
int $options

Return Value

Collection

Collection sortCustom(callable $closure)

Sorts the collection using a custom sorting function. Returns a new Storage instance.

Parameters

callable $closure Callback specification: function ($a, $b): int

Return Value

Collection

Collection sortCustomKey(callable $closure)

Sorts the collection by key using a custom sorting function. Returns a new Storage instance.

Parameters

callable $closure Callback specification: function ($a, $b): int

Return Value

Collection

GuildMember resolve(GuildMember|User|string|int $guildmember)

Resolves given data to a guildmember.

Parameters

GuildMember|User|string|int $guildmember string/int = user ID

Return Value

GuildMember

Exceptions

InvalidArgumentException

GuildMember factory(array $data)

Factory to create (or retrieve existing) guild members.

Parameters

array $data

Return Value

GuildMember