SettingsContainerInterface
extends
JsonSerializable, Serializable
in
a generic container with magic getter and setter
Table of Contents
Methods
- __get() : mixed|null
- Retrieve the value of $property
- __isset() : bool
- Checks if $property is set (aka. not null), excluding private properties
- __set() : void
- Set $property to $value while avoiding private and non-existing properties
- __toString() : string
- __unset() : void
- Unsets $property while avoiding private and non-existing properties
- fromIterable() : static
- Sets properties from a given iterable
- fromJSON() : static
- Sets properties from a given JSON string
- toArray() : array<string, mixed>
- Returns an array representation of the settings object
- toJSON() : string
- Returns a JSON representation of the settings object
Methods
__get()
Retrieve the value of $property
public
__get(string $property) : mixed|null
Parameters
- $property : string
Return values
mixed|null__isset()
Checks if $property is set (aka. not null), excluding private properties
public
__isset(string $property) : bool
Parameters
- $property : string
Return values
bool__set()
Set $property to $value while avoiding private and non-existing properties
public
__set(string $property, mixed $value) : void
Parameters
- $property : string
- $value : mixed
__toString()
public
__toString() : string
Tags
Return values
string__unset()
Unsets $property while avoiding private and non-existing properties
public
__unset(string $property) : void
Parameters
- $property : string
fromIterable()
Sets properties from a given iterable
public
fromIterable(iterable<string|int, mixed> $properties) : static
The values will be run through the magic __set(), which may also call custom setters.
Parameters
- $properties : iterable<string|int, mixed>
Tags
Return values
staticfromJSON()
Sets properties from a given JSON string
public
fromJSON(string $json) : static
Parameters
- $json : string
Tags
Return values
statictoArray()
Returns an array representation of the settings object
public
toArray() : array<string, mixed>
The values will be run through the magic __get(), which may also call custom getters.
Return values
array<string, mixed>toJSON()
Returns a JSON representation of the settings object
public
toJSON([int|null $jsonOptions = null ]) : string
Parameters
- $jsonOptions : int|null = null