\MslsGetSet

Generic class for overloading properties

Summary

Methods
Properties
Constants
__set()
__get()
__isset()
__unset()
reset()
has_value()
is_empty()
get_arr()
No public properties found
No constants found
No protected methods found
$arr
N/A
No private methods found
No private properties found
N/A

Properties

$arr

$arr : array

Generic container for all properties of an instance

Type

array

Methods

__set()

__set(string $key, mixed $value)

Overloads the set method.

Parameters

string $key
mixed $value

__get()

__get(string $key) : mixed

Overloads the get method.

Parameters

string $key

Returns

mixed

__isset()

__isset(string $key) : bool

Overloads the isset method.

Parameters

string $key

Returns

bool

__unset()

__unset(string $key)

Overloads the unset method.

Parameters

string $key

reset()

reset() : \MslsGetSet

Resets the properties container to an empty array.

Returns

\MslsGetSet

has_value()

has_value(string $key) : bool

Checks if the array has an non empty item with the specified key name.

This is method is similar to the overloaded __isset-method since __set cleans empty properties but I use for example

$obj->has_value( $temp )

and not

isset( $obj->$temp )

which is the same but in my opinion a little bit ugly.

Parameters

string $key

Returns

bool

is_empty()

is_empty() : bool

Checks if the properties-container is empty.

Returns

bool

get_arr()

get_arr() : array

Gets the complete properties-container as an array.

Returns

array