\ZyberWareVarManager

VarManager provides an easy way to save variables with getter- and setter-methods.

Summary

Methods
Properties
Constants
__call()
set()
get()
No public properties found
No constants found
No protected methods found
$_vars
N/A
No private methods found
No private properties found
N/A

Properties

$_vars

$_vars : array

Stores all variables.

Type

array

Methods

__call()

__call(string  $call, array  $arguments) : \ZyberWare\VarManager|mixed

Mapper for calls like setMyVariable() and getMyVariable() to $this->set() and $this->get().

Parameters

string $call

The method-name called

array $arguments

The arguments passed

Throws

\ZyberWare\VarManagerException

Throws an exception if the called method-name does not start with "set" or "get".

Returns

\ZyberWare\VarManager|mixed —

$this if mapped to $this->set(), $value if mapped to $this->get().

set()

set(string  $varName, mixed  $value) : \ZyberWare\VarManager

Can be called in two ways: set($varName, $value) or set($varName, $key, $value).

Parameters

string $varName

Under which name should $value be saved?

mixed $value

The value of the variable to be saved.

Returns

\ZyberWare\VarManager

$this

get()

get(string  $varName) : mixed

Can be called in two ways: get($varName) or get($varName, $key).

Parameters

string $varName

The name of the requested variable

Returns

mixed —

The value of the requested variable