ExportFormatter
in package
An implementation of formatting helpers for the CEESV export
This class contains small formatting and validation rules used by the CEESV export scripts. It is used for values that are shared in several places of the export, such as the provider code positions, the filename prefix and the AHV validation.
Example: $positions = exportFormatter::providerCodePositions('9999'); $prefix = exportFormatter::filenamePrefix('9999'); $filename = exportFormatter::exportFilename('9999', '2026', '03', 1713700000, 'A123456'); $ahv_ok = exportFormatter::isValidAhv('756.1234.5678.97');
Tags
Table of Contents
Methods
- exportFilename() : string
- Returns the filename used for the export file.
- filenamePrefix() : string
- Returns the provider code used as prefix for the export filename.
- isValidAhv() : bool
- Validates an AHV number for CEESV export.
- isValidProviderCode() : bool
- Returns whether the provider code can be used for the CEESV export.
- normalizeProviderCode() : string
- Returns the digits-only provider code when it matches the CEESV 3- or 4-digit format.
- providerCodePositions() : array{position104: string, position116: string}
- Returns the provider code values for positions 1.04 and 1.16.
- resolveProviderCode() : string
- Returns the provider code to use for CEESV exports.
Methods
exportFilename()
Returns the filename used for the export file.
public
static exportFilename(mixed $providerCode, mixed $jahr, mixed $monat, mixed $timestamp, mixed $zsr) : string
Parameters
- $providerCode : mixed
- $jahr : mixed
- $monat : mixed
- $timestamp : mixed
- $zsr : mixed
Return values
stringfilenamePrefix()
Returns the provider code used as prefix for the export filename.
public
static filenamePrefix(mixed $providerCode) : string
Parameters
- $providerCode : mixed
Return values
stringisValidAhv()
Validates an AHV number for CEESV export.
public
static isValidAhv(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolisValidProviderCode()
Returns whether the provider code can be used for the CEESV export.
public
static isValidProviderCode(mixed $providerCode) : bool
Parameters
- $providerCode : mixed
Return values
boolnormalizeProviderCode()
Returns the digits-only provider code when it matches the CEESV 3- or 4-digit format.
public
static normalizeProviderCode(mixed $providerCode) : string
Parameters
- $providerCode : mixed
Return values
stringproviderCodePositions()
Returns the provider code values for positions 1.04 and 1.16.
public
static providerCodePositions(mixed $providerCode) : array{position104: string, position116: string}
3-digit provider codes are exported in position 1.04 and 4-digit provider codes are exported in position 1.16.
Parameters
- $providerCode : mixed
Return values
array{position104: string, position116: string}resolveProviderCode()
Returns the provider code to use for CEESV exports.
public
static resolveProviderCode(mixed $providerCode[, mixed $clientId = '' ]) : string
Falls back to the 4-digit code embedded in the CEESV client id.
Parameters
- $providerCode : mixed
- $clientId : mixed = ''