MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

ModesPreference

MMO\client\events · 1 symbole · générée le 27 Oct 2026

class

ModesPreference

ModesPreference.php:13

The modes whoever is asking chose, or the ones they are given by default: mmo.client keeps no user, mmo.oauth answers -- user with what the user saved (their config.modes), default with what their roles give (Role::$modes). The answer is {level, layers}, either key left out when it says nothing of it.

class MMO\client\events\ModesPreference extends MMO\core\events\Signal
Espace de noms
MMO\client\events
Étend
Signal
ModesPreference::AddListener(fn(ModesPreference $e) => ($e->source === 'user')? $e->setReturn(['level' => 'simple']) : null);

Index

DEFAULTthe modes the user's roles give
USERthe modes the user saved
source readonly
__construct($origin, $source)

Constantes2

DEFAULT

the modes the user's roles give

const DEFAULT = 'default'

USER

the modes the user saved

const USER = 'user'

Propriétés1

source

readonly
readonly string $source
Type
string

Méthodes1

Membres hérités (16)
PropriétésDéclaré parDescription
ListenersEvent
originEvent
returnValueSignal
MéthodesDéclaré parDescription
AddListener($handler, $order)EventRegister a listener directly (as opposed to ConnectListeners's attribute-based discovery).
ConnectListeners($obj)EventScan $obj's methods for #[Listen(EventClass::class)] attributes and register each one as a listener on the matching event class.
DisconnectListeners($obj)EventUndo a previous ConnectListeners: removes every listener that connect had registered for $obj on this event class.
dispatch()EventInvoke every GetListeners listener with $this.
GetListeners()EventCollect every listener for this class, including those registered on its parent classes (so a subclass event is also caught by listeners of its parent event), sorted by ascending $order (ties keep …
getOrigin()Event
getReturn()Signal
HasListener($handler)Event
hasReturn()Signal
RemoveListener($handler)EventRemove the last added handler from the listeners.
Send($args)EventConstruct a new instance of this class with $args, then dispatch it to every listener.
SetListenerOrder($handler, $order)EventChange the order of an already-registered listener, whether added directly via AddListener or indirectly via ConnectListeners (which also stores its [$obj, $methodName] callables here).
setReturn($value, $stop)Signal