Documentation

CantonService
in package

Logic originally from CantonController, extracted here as part of the controller removal (task #48636).

The canton's kvg_uvg field is basically a type code that tells us what kind of insurance provider the canton is - this service translates those codes into something meaningful for the rest of the app.

Long term this logic should probably live in the Canton domain object itself.

Table of Contents

Methods

__construct()  : mixed
fetchForCantonSelectBox()  : array<string|int, mixed>
Builds the canton select box array for templates.
isAMilitaryOrAccidentCantonalProvider()  : bool
Returns true if the canton handles military or accident insurance (UV/MV).
isAnIVProvider()  : bool
Returns true if the canton is an IV (disability insurance) provider.

Methods

__construct()

public __construct(mixed $dbc) : mixed
Parameters
$dbc : mixed

fetchForCantonSelectBox()

Builds the canton select box array for templates.

public fetchForCantonSelectBox() : array<string|int, mixed>

Excludes the "across Switzerland" option and pre-selects the current one.

Tags
todo

remove - no usage found

Return values
array<string|int, mixed>

isAMilitaryOrAccidentCantonalProvider()

Returns true if the canton handles military or accident insurance (UV/MV).

public isAMilitaryOrAccidentCantonalProvider(int $cantonId) : bool

kvg_uvg 4 and 5 both fall into this category.

Parameters
$cantonId : int
Tags
todo

remove - no usage found

Return values
bool

isAnIVProvider()

Returns true if the canton is an IV (disability insurance) provider.

public isAnIVProvider(int $cantonId) : bool

kvg_uvg === 2 means IV.

Parameters
$cantonId : int
Return values
bool

        
On this page

Search results