CompanyType
in package
Class CompanyType
This class manages company types, including retrieving, creating, and updating company type records in the database.
Table of Contents
Properties
Methods
- __construct() : mixed
- createByAdmin() : void
- Create a company type (admin).
- getAll() : array<int, array<string, mixed>>
- Get all company types (for admin list).
- updateByCode() : void
- Update company_type by code (admin).
Properties
$mySql
protected
MySql
$mySql
Methods
__construct()
public
__construct(MySql $mySql) : mixed
Parameters
- $mySql : MySql
createByAdmin()
Create a company type (admin).
public
createByAdmin(array<string|int, mixed> $data) : void
Expected keys in $data:
- company_type_code (string, required)
- company_type_name (string, required)
- company_type_listed (string|null)
- company_type_report (string|null)
- company_type_valid_from (int|null)
- company_type_valid_to (int|null)
- company_type_min_employee_number (int|null)
- company_type_max_employee_number (int|null)
- company_type_min_revenue (int|null)
- company_type_max_revenue (int|null)
- company_type_min_balance (int|null)
- company_type_max_balance (int|null)
- reference_code (string, required)
- sort_order (int|null)
- status (int, required)
- createdby (string, required)
- modifiedby (string, required)
Parameters
- $data : array<string|int, mixed>
getAll()
Get all company types (for admin list).
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>> —List of company types.
updateByCode()
Update company_type by code (admin).
public
updateByCode(array<string|int, mixed> $data) : void
Expects at least:
- company_type_code (string, required)
- modifiedby (string, required)
Other fields are optional and will be updated if present (nullable).
Parameters
- $data : array<string|int, mixed>