Allocations

7 events in this category

stormnodes:admin:allocations:allocation:created

Callback parameters: array allocation data.

onAllocationCreated

Event Data Structure

This event receives the following data when emitted:

allocations
created_by
created_count

Emitted from:

backend/app/Controllers/Admin/AllocationsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\AllocationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(AllocationsEvent::onAllocationCreated(), function ($allocations, $createdBy, $createdCount) {
        // Handle stormnodes:admin:allocations:allocation:created
        // Data keys: allocations, created_by, created_count
    });
}

stormnodes:admin:allocations:allocation:deleted

Callback parameters: int allocation id, array allocation data.

onAllocationDeleted

Event Data Structure

This event receives the following data when emitted:

allocation
deleted_by
deleted_count
ids
ip
node_id
skipped_count

Emitted from:

backend/app/Controllers/Admin/AllocationsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\AllocationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(AllocationsEvent::onAllocationDeleted(), function ($allocation, $deletedBy, $deletedCount, $ids, $ip, $nodeId, $skippedCount) {
        // Handle stormnodes:admin:allocations:allocation:deleted
        // Data keys: allocation, deleted_by, deleted_count, ids, ip, node_id, skipped_count
    });
}

stormnodes:admin:allocations:allocation:not:found

Callback parameters: int allocation id, string error message.

onAllocationNotFound

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\AllocationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(AllocationsEvent::onAllocationNotFound(), function ($id, $message) {
        // Handle stormnodes:admin:allocations:allocation:not:found
        // Parameters: int allocation id, string error message.
    });
}

stormnodes:admin:allocations:allocation:retrieved

Callback parameters: int allocation id, array allocation data.

onAllocationRetrieved

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\AllocationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(AllocationsEvent::onAllocationRetrieved(), function ($id, $data) {
        // Handle stormnodes:admin:allocations:allocation:retrieved
        // Parameters: int allocation id, array allocation data.
    });
}

stormnodes:admin:allocations:error

Callback parameters: string error message, array context.

onAllocationsError

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\AllocationsEvent;

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

stormnodes:admin:allocations:retrieved

Callback parameters: array allocations list.

onAllocationsRetrieved

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\AllocationsEvent;

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

stormnodes:admin:allocations:allocation:updated

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

onAllocationUpdated

Event Data Structure

This event receives the following data when emitted:

allocation
updated_by
updated_data

Emitted from:

backend/app/Controllers/Admin/AllocationsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\AllocationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(AllocationsEvent::onAllocationUpdated(), function ($allocation, $updatedBy, $updatedData) {
        // Handle stormnodes:admin:allocations:allocation:updated
        // Data keys: allocation, updated_by, updated_data
    });
}