Documentation

AccidentType
in package

The AccidentType class manages CRUD operations for accident types.

It provides methods for fetching, creating, and updating accident type records.

Table of Contents

Properties

$mySql  : MySql

Methods

__construct()  : mixed
createByAdmin()  : void
Create a new accident type (admin).
getAll()  : array<int, array<string, mixed>>
Get all accident types by status.
getByCode()  : array<string, mixed>
Get a single accident type by its code.
updateByCode()  : void
Update an accident type by code (admin).

Properties

Methods

createByAdmin()

Create a new accident type (admin).

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

Expects in $data:

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

getAll()

Get all accident types by status.

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

List of allowed status values.

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

getByCode()

Get a single accident type by its code.

public getByCode(string $accidentTypeCode) : array<string, mixed>
Parameters
$accidentTypeCode : string
Return values
array<string, mixed>

updateByCode()

Update an accident type by code (admin).

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

Expects in $data:

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

        
On this page

Search results