Documentation

CompanyCurrency
in package

Class CompanyCurrency

This class provides methods for managing company-currency assignments. It allows you to list active currencies linked to companies, create or update assignments, and soft delete existing assignments. Each method ensures interaction with the database for maintaining consistency in the currency assignments for a company.

Table of Contents

Properties

$db  : MySql

Methods

__construct()  : mixed
deleteAssignment()  : void
Soft delete a company ↔ currency assignment (status = 9).
listOptions()  : array{company_code: string, checked_currencies: string[]}
List all active currency codes linked to a company.
saveAssignment()  : void
Create or reactivate a company ↔ currency assignment.

Properties

Methods

deleteAssignment()

Soft delete a company ↔ currency assignment (status = 9).

public deleteAssignment(array<string, mixed> $data) : void

Expects in $data:

  • company_code (string, required)
  • currency_code (string, required)
  • modifiedby (string, required)
Parameters
$data : array<string, mixed>

listOptions()

List all active currency codes linked to a company.

public listOptions(string $companyCode, array<string|int, int> $statuses) : array{company_code: string, checked_currencies: string[]}
Parameters
$companyCode : string
$statuses : array<string|int, int>
Return values
array{company_code: string, checked_currencies: string[]}

saveAssignment()

Create or reactivate a company ↔ currency assignment.

public saveAssignment(array<string, mixed> $data) : void

Expects in $data:

  • company_code (string, required)
  • currency_code (string, required)
  • sort_order (int|null)
  • createdby (string, required)
  • modifiedby (string, required)
Parameters
$data : array<string, mixed>

        
On this page

Search results