class lang_helper

Custom Profile Fields

Properties

protected array $options_lang

Array with the language option, grouped by field and language

protected driver_interface $db

Database object

protected string $language_table

Table where the language strings are stored

Methods

__construct(driver_interface $db, string $language_table)

Construct

load_preview_options(int $field_id, int $lang_id, mixed $preview_options)

Loads preview options into language entries for options

load_option_lang(int $lang_id)

Fetches language entries for options from DB

bool
is_set(int $field_id, int $lang_id = null, int $field_value = null)

Are language options set for this field?

string
get(int $field_id, int $lang_id, int $field_value = null)

Get the selected language string

Details

at line 45
__construct(driver_interface $db, string $language_table)

Construct

Parameters

driver_interface $db

Database object

string $language_table

Table where the language strings are stored

at line 58
load_preview_options(int $field_id, int $lang_id, mixed $preview_options)

Loads preview options into language entries for options

Parameters

int $field_id
int $lang_id
mixed $preview_options

at line 81
load_option_lang(int $lang_id)

Fetches language entries for options from DB

Parameters

int $lang_id

at line 106
bool is_set(int $field_id, int $lang_id = null, int $field_value = null)

Are language options set for this field?

Parameters

int $field_id

Database ID of the field

int $lang_id

ID of the language

int $field_value

Selected value of the field

Return Value

bool

at line 131
string get(int $field_id, int $lang_id, int $field_value = null)

Get the selected language string

Parameters

int $field_id

Database ID of the field

int $lang_id

ID of the language

int $field_value

Selected value of the field

Return Value

string