PlantMachine
in package
Class PlantMachine
Handles operations related to plant machines, including retrieval, creation, and updates. This class provides both general queries and admin operations for managing plant machines within a database system.
Table of Contents
Properties
Methods
- __construct() : mixed
- createByAdmin() : void
- Create a plant machine (admin).
- getAll() : array<int, array<string, mixed>>
- Get all plant machines for the given statuses.
- getByCode() : array<string, mixed>
- Get a plant machine by code.
- updateByCode() : void
- Update plant machine by code (admin).
Properties
$mySql
protected
MySql
$mySql
Methods
__construct()
public
__construct(MySql $mySql) : mixed
Parameters
- $mySql : MySql
createByAdmin()
Create a plant machine (admin).
public
createByAdmin(array<string, mixed> $data) : void
Expects in $data:
- plant_machine_code (string, required)
- plant_machine_name (string, required)
- plant_machine_short (string|null)
- plant_machine_type (string|null)
- plant_machine_subtype (string|null)
- plant_department_code (string, required, FK by code)
- sort_order (int|null)
- status (int, required)
- createdby (string, required)
- modifiedby (string, required)
Parameters
- $data : array<string, mixed>
getAll()
Get all plant machines for the given statuses.
public
getAll(array<string|int, int> $statuses) : array<int, array<string, mixed>>
Parameters
- $statuses : array<string|int, int>
Return values
array<int, array<string, mixed>>getByCode()
Get a plant machine by code.
public
getByCode(string $code) : array<string, mixed>
Parameters
- $code : string
Return values
array<string, mixed>updateByCode()
Update plant machine by code (admin).
public
updateByCode(array<string, mixed> $data) : void
Expects in $data:
- plant_machine_code (string, required)
- plant_machine_name (string|null)
- plant_machine_short (string|null)
- plant_machine_type (string|null)
- plant_machine_subtype (string|null)
- plant_department_code (string|null, if omitted dept is unchanged)
- sort_order (int|null)
- status (int|null)
- modifiedby (string, required)
Parameters
- $data : array<string, mixed>