DatapointTopic
in package
Class DatapointTopic
Handles operations on datapoint topics, including retrieval, creation, and updates. The class interacts with a MySQL database to perform various functions like fetching datapoint topics based on specific criteria, and managing administrative tasks such as creating or updating topics.
Table of Contents
Properties
Methods
- __construct() : mixed
- createByAdmin() : void
- Create a datapoint topic (admin).
- getAll() : array<int, array<string, mixed>>
- Get all datapoint topics for given statuses.
- getByCode() : array<string, mixed>
- Get a datapoint topic by code.
- updateByCode() : void
- Update datapoint topic by code (admin).
Properties
$mySql
protected
MySql
$mySql
Methods
__construct()
public
__construct(MySql $mySql) : mixed
Parameters
- $mySql : MySql
createByAdmin()
Create a datapoint topic (admin).
public
createByAdmin(array<string, mixed> $data) : void
Expects in $data:
- datapoint_topic_code (string, required)
- datapoint_topic_name (string, required)
- reference_code (string, required)
- hierarchy_code (string, required)
- sort_order (int|null)
- status (int, required)
- createdby (string, required)
- modifiedby (string, required)
Parameters
- $data : array<string, mixed>
getAll()
Get all datapoint topics for 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 datapoint topic by code.
public
getByCode(string $code) : array<string, mixed>
Parameters
- $code : string
Return values
array<string, mixed>updateByCode()
Update datapoint topic by code (admin).
public
updateByCode(array<string, mixed> $data) : void
Expects in $data:
- datapoint_topic_code (string, required)
- datapoint_topic_name (string|null)
- reference_code (string, required)
- hierarchy_code (string, required)
- sort_order (int|null)
- status (int|null)
- modifiedby (string, required)
Parameters
- $data : array<string, mixed>