Heratio Framework API Reference

FeatureToggleService
in package

Feature Toggle Service.

Manages feature flags for institutions.

Table of Contents

Methods

createToggle()  : int
Create a new feature toggle.
deleteToggle()  : bool
Delete a feature toggle.
getAllToggles()  : Collection
Get all feature toggles for an institution.
getConfig()  : array<string|int, mixed>|null
Get feature configuration.
isEnabled()  : bool
Check if a feature is enabled.
toggle()  : bool
Toggle a feature on/off.
updateToggle()  : bool
Update a feature toggle.

Methods

createToggle()

Create a new feature toggle.

public createToggle(array<string|int, mixed> $data[, int|null $institutionId = null ]) : int
Parameters
$data : array<string|int, mixed>
$institutionId : int|null = null
Return values
int

deleteToggle()

Delete a feature toggle.

public deleteToggle(int $id) : bool
Parameters
$id : int
Return values
bool

getAllToggles()

Get all feature toggles for an institution.

public getAllToggles([int|null $institutionId = null ]) : Collection
Parameters
$institutionId : int|null = null
Return values
Collection

getConfig()

Get feature configuration.

public getConfig(string $featureCode[, int|null $institutionId = null ]) : array<string|int, mixed>|null
Parameters
$featureCode : string
$institutionId : int|null = null
Return values
array<string|int, mixed>|null

isEnabled()

Check if a feature is enabled.

public isEnabled(string $featureCode[, int|null $institutionId = null ]) : bool
Parameters
$featureCode : string
$institutionId : int|null = null
Return values
bool

toggle()

Toggle a feature on/off.

public toggle(string $featureCode[, int|null $institutionId = null ]) : bool
Parameters
$featureCode : string
$institutionId : int|null = null
Return values
bool

updateToggle()

Update a feature toggle.

public updateToggle(string $featureCode, array<string|int, mixed> $data[, int|null $institutionId = null ]) : bool
Parameters
$featureCode : string
$data : array<string|int, mixed>
$institutionId : int|null = null
Return values
bool

        
On this page

Search results