Spells

14 events in this category

stormnodes:admin:spells:spell:created

Callback parameters: array spell data.

onSpellCreated

Event Data Structure

This event receives the following data when emitted:

created_by
spell

Emitted from:

backend/app/Controllers/Admin/SpellsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellCreated(), function ($createdBy, $spell) {
        // Handle stormnodes:admin:spells:spell:created
        // Data keys: created_by, spell
    });
}

stormnodes:admin:spells:spell:deleted

Callback parameters: int spell id, array spell data.

onSpellDeleted

Event Data Structure

This event receives the following data when emitted:

deleted_by
spell

Emitted from:

backend/app/Controllers/Admin/SpellsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellDeleted(), function ($deletedBy, $spell) {
        // Handle stormnodes:admin:spells:spell:deleted
        // Data keys: deleted_by, spell
    });
}

stormnodes:admin:spells:spell:exported

Callback parameters: int spell id, array export data.

onSpellExported

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellExported(), function ($id, $data) {
        // Handle stormnodes:admin:spells:spell:exported
        // Parameters: int spell id, array export data.
    });
}

stormnodes:admin:spells:spell:not:found

Callback parameters: int spell id, string error message.

onSpellNotFound

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellNotFound(), function ($id, $message) {
        // Handle stormnodes:admin:spells:spell:not:found
        // Parameters: int spell id, string error message.
    });
}

stormnodes:admin:spells:spell:retrieved

Callback parameters: int spell id, array spell data.

onSpellRetrieved

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellRetrieved(), function ($id, $data) {
        // Handle stormnodes:admin:spells:spell:retrieved
        // Parameters: int spell id, array spell data.
    });
}

stormnodes:admin:spells:by:realm:retrieved

Callback parameters: int realm id, array spells.

onSpellsByRealmRetrieved

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellsByRealmRetrieved(), function ($id, $spells) {
        // Handle stormnodes:admin:spells:by:realm:retrieved
        // Parameters: int realm id, array spells.
    });
}

stormnodes:admin:spells:error

Callback parameters: string error message, array context.

onSpellsError

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellsError(), function ($message, $context) {
        // Handle stormnodes:admin:spells:error
        // Parameters: string error message, array context.
    });
}

stormnodes:admin:spells:spells:imported

Callback parameters: array import data, array results.

onSpellsImported

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellsImported(), function ($data, $results) {
        // Handle stormnodes:admin:spells:spells:imported
        // Parameters: array import data, array results.
    });
}

stormnodes:admin:spells:retrieved

Callback parameters: array spells list.

onSpellsRetrieved

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellsRetrieved(), function ($list) {
        // Handle stormnodes:admin:spells:retrieved
        // Parameters: array spells list.
    });
}

stormnodes:admin:spells:spell:updated

Callback parameters: int spell id, array old data, array new data.

onSpellUpdated

Event Data Structure

This event receives the following data when emitted:

spell
updated_by
updated_data

Emitted from:

backend/app/Controllers/Admin/SpellsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellUpdated(), function ($spell, $updatedBy, $updatedData) {
        // Handle stormnodes:admin:spells:spell:updated
        // Data keys: spell, updated_by, updated_data
    });
}

stormnodes:admin:spells:variable:created

Callback parameters: int spell id, array variable data.

onSpellVariableCreated

Event Data Structure

This event receives the following data when emitted:

spell_id
variable

Emitted from:

backend/app/Controllers/Admin/SpellsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellVariableCreated(), function ($spellId, $variable) {
        // Handle stormnodes:admin:spells:variable:created
        // Data keys: spell_id, variable
    });
}

stormnodes:admin:spells:variable:deleted

Callback parameters: int variable id, array variable data.

onSpellVariableDeleted

Event Data Structure

This event receives the following data when emitted:

variable

Emitted from:

backend/app/Controllers/Admin/SpellsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellVariableDeleted(), function ($variable) {
        // Handle stormnodes:admin:spells:variable:deleted
        // Data keys: variable
    });
}

stormnodes:admin:spells:variables:retrieved

Callback parameters: int spell id, array variables.

onSpellVariablesRetrieved

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellVariablesRetrieved(), function ($id, $variables) {
        // Handle stormnodes:admin:spells:variables:retrieved
        // Parameters: int spell id, array variables.
    });
}

stormnodes:admin:spells:variable:updated

Callback parameters: int variable id, array old data, array new data.

onSpellVariableUpdated

Event Data Structure

This event receives the following data when emitted:

updated_data
variable

Emitted from:

backend/app/Controllers/Admin/SpellsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\SpellsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(SpellsEvent::onSpellVariableUpdated(), function ($updatedData, $variable) {
        // Handle stormnodes:admin:spells:variable:updated
        // Data keys: updated_data, variable
    });
}