DataPoint
in package
Class representing operations on datapoints in the database.
Table of Contents
Properties
Methods
- __construct() : mixed
- createByAdmin() : void
- Create a datapoint (admin).
- getAll() : array<int, array<string, mixed>>
- Get all datapoints for the given statuses.
- getByCode() : array<string, mixed>
- Get a single datapoint by code.
- updateByCode() : void
- Update datapoint by code (admin).
Properties
$mySql
protected
MySql
$mySql
Methods
__construct()
public
__construct(MySql $mySql) : mixed
Parameters
- $mySql : MySql
createByAdmin()
Create a datapoint (admin).
public
createByAdmin(array<string, mixed> $data) : void
Expects in $data:
- datapoint_code (string, required)
- datapoint_name (string, required)
- reference_code (string, required)
- datapoint_subtopic_code (string, required)
- unit_code (string, required)
- sort_order (int|null)
- status (int, required)
- createdby (string, required)
- modifiedby (string, required)
Parameters
- $data : array<string, mixed>
getAll()
Get all datapoints 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 single datapoint by code.
public
getByCode(string $dataPointCode) : array<string, mixed>
Parameters
- $dataPointCode : string
Return values
array<string, mixed>updateByCode()
Update datapoint by code (admin).
public
updateByCode(array<string, mixed> $data) : void
Expects in $data:
- datapoint_code (string, required)
- datapoint_name (string|null)
- reference_code (string, required)
- datapoint_subtopic_code (string, required)
- unit_code (string, required)
- sort_order (int|null)
- status (int|null)
- modifiedby (string, required)
Parameters
- $data : array<string, mixed>