class ViewModel implements ArrayAccess (View source)

The ViewModel class.

Methods

getModel(string $name = null)

Method to get property Model

setModel(ModelRepository $model, bool $default = null, string $customName = null)

Method to set property model

mixed
get(string $name, string $modelName = null, array $args)

get

mixed
load(string $name, string $modelName = null, array $args)

get

removeModel(string $name)

removeModel

boolean
exists(string $name)

Method to check a model exists.

mixed
__call(string $name, array $args)

__call

boolean
offsetExists(mixed $offset)

Is a property exists or not.

mixed
offsetGet(mixed $offset)

Get a property.

void
offsetSet(mixed $offset, mixed $value)

Set a value to property.

void
offsetUnset(mixed $offset)

Unset a property.

int
count()

Count this object.

getNullModel()

Method to get property NullModel

setNullModel(ModelRepository $nullModel)

Method to set property nullModel

Details

at line line 48
ModelRepository getModel(string $name = null)

Method to get property Model

Parameters

string $name

Return Value

ModelRepository

at line line 74
ViewModel setModel(ModelRepository $model, bool $default = null, string $customName = null)

Method to set property model

Parameters

ModelRepository $model
bool $default
string $customName

Return Value

ViewModel Return self to support chaining.

at line line 98
mixed get(string $name, string $modelName = null, array $args)

get

Parameters

string $name
string $modelName
array $args

Return Value

mixed

at line line 126
mixed load(string $name, string $modelName = null, array $args)

get

Parameters

string $name
string $modelName
array $args

Return Value

mixed

at line line 152
ViewModel removeModel(string $name)

removeModel

Parameters

string $name

Return Value

ViewModel

at line line 172
boolean exists(string $name)

Method to check a model exists.

Parameters

string $name The model name to check.

Return Value

boolean True if exists.

at line line 185
mixed __call(string $name, array $args)

__call

Parameters

string $name
array $args

Return Value

mixed

at line line 199
boolean offsetExists(mixed $offset)

Is a property exists or not.

Parameters

mixed $offset Offset key.

Return Value

boolean

at line line 212
mixed offsetGet(mixed $offset)

Get a property.

Parameters

mixed $offset Offset key.

Return Value

mixed The value to return.

Exceptions

InvalidArgumentException

at line line 226
void offsetSet(mixed $offset, mixed $value)

Set a value to property.

Parameters

mixed $offset Offset key.
mixed $value The value to set.

Return Value

void

Exceptions

InvalidArgumentException

at line line 239
void offsetUnset(mixed $offset)

Unset a property.

Parameters

mixed $offset Offset key to unset.

Return Value

void

Exceptions

InvalidArgumentException

at line line 249
int count()

Count this object.

Return Value

int

at line line 259
ModelRepository getNullModel()

Method to get property NullModel

Return Value

ModelRepository

at line line 281
ViewModel setNullModel(ModelRepository $nullModel)

Method to set property nullModel

Parameters

ModelRepository $nullModel

Return Value

ViewModel Return self to support chaining.