\Settings_Model

Summary

Methods
Properties
Constants
__construct()
get_setting()
set_setting()
remove_setting()
save_settings()
get_settings()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct() 

Class Constructor

get_setting()

get_setting(string  $name) : string

Get setting value from database.

This method returns a system setting from the database.

Parameters

string $name

The database setting name.

Returns

string —

Returns the database value for the selected setting.

set_setting()

set_setting(string  $name, \type  $value) : integer

This method sets the value for a specific setting on the database. If the setting doesn't exist, it is going to be created, otherwise updated.

Parameters

string $name

The setting name.

\type $value

The setting value.

Returns

integer —

Returns the setting database id.

remove_setting()

remove_setting(string  $name) : boolean

Remove a setting from the database.

Parameters

string $name

The setting name to be removed.

Returns

boolean —

Returns the delete operation result.

save_settings()

save_settings(array  $settings) : boolean

Saves all the system settings into the database.

This method is usefull when trying to save all the system settings at once instead of saving them one by one.

Parameters

array $settings

Contains all the system settings.

Throws

\Exception

When the update operation won't work for a specific setting.

Returns

boolean —

Returns the save operation result.

get_settings()

get_settings() : array

Returns all the system settings at once.

Returns

array —

Array of all the system settings stored in the 'ea_settings' table.