Documentation

Status
in package

Class Status

This class handles operations related to the status table, including retrieving, creating, and updating statuses. It provides both general and admin-specific methods.

Table of Contents

Properties

$mySql  : MySql

Methods

__construct()  : mixed
createByAdmin()  : void
Create a new status (admin).
getByCode()  : array<string, mixed>
Get a single status by its code.
getStatusAll()  : array<int, array<string, mixed>>
Retrieve all statuses filtered by their own status flag.
getStatusOptions()  : mixed
updateByCode()  : void
Update an existing status by its code (admin).

Properties

Methods

createByAdmin()

Create a new status (admin).

public createByAdmin(array<string, mixed> $data) : void

Expects in $data:

  • status_code (int|string, required)
  • status_name (string, required)
  • status (int, required)
  • sort_order (int|null)
  • createdby (string, required)
  • modifiedby (string, required)
Parameters
$data : array<string, mixed>

getByCode()

Get a single status by its code.

public getByCode(string|int $code) : array<string, mixed>
Parameters
$code : string|int
Return values
array<string, mixed>

getStatusAll()

Retrieve all statuses filtered by their own status flag.

public getStatusAll(array<string|int, int> $statuses) : array<int, array<string, mixed>>
Parameters
$statuses : array<string|int, int>

List of allowed status values (e.g. [1] for active).

Return values
array<int, array<string, mixed>>

getStatusOptions()

public getStatusOptions() : mixed

updateByCode()

Update an existing status by its code (admin).

public updateByCode(array<string, mixed> $data) : void

Expects in $data:

  • status_code (int|string, required)
  • status_name (string|null)
  • sort_order (int|null)
  • status (int|null)
  • modifiedby (string, required)
Parameters
$data : array<string, mixed>

        
On this page

Search results