Heratio Framework API Reference

AhgSettingsService
in package

AHG Settings Service

Centralized service for reading AHG settings from database. Use this class to check settings before executing features.

Table of Contents

Methods

clearCache()  : void
Clear the cache (call after saving settings)
get()  : mixed
Get a single setting value
getBool()  : bool
Get a boolean setting (handles string 'true'/'false')
getGroup()  : array<string|int, mixed>
Get all settings for a group
getInt()  : int
Get an integer setting
isEnabled()  : bool
Check if a feature is enabled
set()  : bool
Save a setting

Methods

clearCache()

Clear the cache (call after saving settings)

public static clearCache() : void

get()

Get a single setting value

public static get(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null

getBool()

Get a boolean setting (handles string 'true'/'false')

public static getBool(string $key[, bool $default = false ]) : bool
Parameters
$key : string
$default : bool = false
Return values
bool

getGroup()

Get all settings for a group

public static getGroup(string $group) : array<string|int, mixed>
Parameters
$group : string
Return values
array<string|int, mixed>

getInt()

Get an integer setting

public static getInt(string $key[, int $default = 0 ]) : int
Parameters
$key : string
$default : int = 0
Return values
int

isEnabled()

Check if a feature is enabled

public static isEnabled(string $feature) : bool
Parameters
$feature : string
Return values
bool

set()

Save a setting

public static set(string $key, mixed $value[, string $group = 'general' ]) : bool
Parameters
$key : string
$value : mixed
$group : string = 'general'
Return values
bool

        
On this page

Search results