Documentation

ReactionContextsManager extends Instanceable
in package

Manages registering and retrieving reaction contexts.

Tags
author

Aberdeener

version
2.2.0
license

MIT

see
ReactionContext

Table of Contents

Properties

$_contexts  : array<string|int, ReactionContext>
$_instances  : array<class-string, static>
Stores instances of classes with their class name as key.

Methods

getContext()  : ReactionContext|null
Get a reaction context by name.
getContexts()  : array<string|int, ReactionContext>
Get all registered reaction contexts.
getInstance()  : static
Get or make an instance of the class this was called on.
provideContext()  : void
Register a new reaction context.
validContextFriendlyNames()  : array<string|int, string>
Get all valid reaction context friendly names.
validContextNames()  : array<string|int, string>
Get all valid reaction context names.
enabledContexts()  : array<string|int, ReactionContext>
Get all enabled reaction contexts.

Properties

$_instances

Stores instances of classes with their class name as key.

private static array<class-string, static> $_instances = []

Methods

getContext()

Get a reaction context by name.

public getContext(string $name) : ReactionContext|null
Parameters
$name : string

Name of reaction context to get.

Return values
ReactionContext|null

Reaction context with the given name, or throws error if it does not exist.

getInstance()

Get or make an instance of the class this was called on.

public final static getInstance() : static
Return values
static

Instance of the class this was called on.

validContextFriendlyNames()

Get all valid reaction context friendly names.

public validContextFriendlyNames(Language $language) : array<string|int, string>
Parameters
$language : Language

Language to translate friendly names in.

Return values
array<string|int, string>

All valid reaction context friendly names.

validContextNames()

Get all valid reaction context names.

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

All valid reaction context names.


        
On this page

Search results