Locations

7 events in this category

stormnodes:admin:locations:location:created

Callback parameters: array location data.

onLocationCreated

Event Data Structure

This event receives the following data when emitted:

created_by
location

Emitted from:

backend/app/Controllers/Admin/LocationsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\LocationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(LocationsEvent::onLocationCreated(), function ($createdBy, $location) {
        // Handle stormnodes:admin:locations:location:created
        // Data keys: created_by, location
    });
}

stormnodes:admin:locations:location:deleted

Callback parameters: int location id, array location data.

onLocationDeleted

Event Data Structure

This event receives the following data when emitted:

deleted_by
location

Emitted from:

backend/app/Controllers/Admin/LocationsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\LocationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(LocationsEvent::onLocationDeleted(), function ($deletedBy, $location) {
        // Handle stormnodes:admin:locations:location:deleted
        // Data keys: deleted_by, location
    });
}

stormnodes:admin:locations:location:not:found

Callback parameters: int location id, string error message.

onLocationNotFound

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\LocationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(LocationsEvent::onLocationNotFound(), function ($id, $message) {
        // Handle stormnodes:admin:locations:location:not:found
        // Parameters: int location id, string error message.
    });
}

stormnodes:admin:locations:location:retrieved

Callback parameters: int location id, array location data.

onLocationRetrieved

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\LocationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(LocationsEvent::onLocationRetrieved(), function ($id, $data) {
        // Handle stormnodes:admin:locations:location:retrieved
        // Parameters: int location id, array location data.
    });
}

stormnodes:admin:locations:error

Callback parameters: string error message, array context.

onLocationsError

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\LocationsEvent;

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

stormnodes:admin:locations:retrieved

Callback parameters: array locations list.

onLocationsRetrieved

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\LocationsEvent;

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

stormnodes:admin:locations:location:updated

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

onLocationUpdated

Event Data Structure

This event receives the following data when emitted:

location
updated_by
updated_data

Emitted from:

backend/app/Controllers/Admin/LocationsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\LocationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(LocationsEvent::onLocationUpdated(), function ($location, $updatedBy, $updatedData) {
        // Handle stormnodes:admin:locations:location:updated
        // Data keys: location, updated_by, updated_data
    });
}