GravityKit\GravityView\Settings\Settings
A generic Settings base class.
Since:
2.03.0.0(Migrated to GravityKit\GravityView\Settings namespace.)
Source: src/Settings/Settings.php:19
Details
- Kind:
class - Namespace:
GravityKit\GravityView\Settings
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
\GV\Settings
Since: 2.0
Source: src/Settings/Settings.php:34
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: src/Settings/Settings.php:49
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: src/Settings/Settings.php:66
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: src/Settings/Settings.php:80
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: src/Settings/Settings.php:91