Report
in package
The Report class provides methods to interact with report data in the database.
It includes functionality to retrieve reports by code and create new reports.
Table of Contents
Properties
Methods
- __construct() : mixed
- create() : int
- Create a report (admin).
- getByCode() : array<string|int, mixed>
Properties
$codeRangeGenerator
protected
CodeRangeGenerator
$codeRangeGenerator
$db
protected
MySql
$db
Methods
__construct()
public
__construct(MySql $db, CodeRangeGenerator $codeRangeGenerator) : mixed
Parameters
- $db : MySql
- $codeRangeGenerator : CodeRangeGenerator
create()
Create a report (admin).
public
create(array<string, mixed> $data) : int
Expects in $data:
- report_name (string, required)
- company_id (int, required OR company_code)
- company_code (string, required OR company_id)
- report_type_id (int|null)
- report_type_code (string|null)
- time_period_id (int|null)
- time_period_code (string|null)
- main_export_format_code (string|null)
- report_description (string|null)
- sort_order (int|null)
- status (int, default 1)
- createdby (string, required)
- modifiedby (string, required)
Parameters
- $data : array<string, mixed>
Tags
Return values
int —newly created report.code
getByCode()
public
getByCode(string $code) : array<string|int, mixed>
Parameters
- $code : string