GV\Settings
A generic Settings base class.
Source: future/includes/class-gv-settings.php:12
Details
- Kind:
class - Namespace:
GV
Methods
| Method | Description |
|---|---|
__construct() | Create with new. |
update() | Mass update values from the allowed ones. |
set() | Set a setting. |
get() | Set an setting. |
all() | Returns all the objects in this collection as an an array. |
Method Reference
__construct()
public function __construct( $settings=[] )
Create with new.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$settings | array | [] | Initial settings. Default: none. |
Returns
Since: 2.0
Source: future/includes/class-gv-settings.php:27
update()
public function update( $settings )
Mass update values from the allowed ones.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$settings | array | An array of settings to update. |
Returns
- \GV\Settings — self chain.
Since: 2.0
Source: future/includes/class-gv-settings.php:42
set()
public function set( $key, $value )
Set a setting.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$key | mixed | The key the value should be added under. | |
$value | mixed | The value to be added to the key. |
Returns
void
Since: 2.0
Source: future/includes/class-gv-settings.php:59
get()
public function get( $key, $default=null )
Set an setting.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$key | mixed | The key in this setting to retrieve. | |
$default | mixed | null | A default in case the key is not set. |
Returns
mixed|null
Since: 2.0
Source: future/includes/class-gv-settings.php:73
all()
public function all()
Returns all the objects in this collection as an an array.
Returns
array— The objects in this collection.
Since: 2.0
Source: future/includes/class-gv-settings.php:84