class ModelRepository implements ArrayAccess (View source)

Class DatabaseModel

Traits

The BootableTrait class.
The MultiSingletonTrait class.

Methods

static SingletonTrait
getInstance(array $args)

getInstance

static mixed
setInstance(object $instance)

setInstance

__construct(Structure|array $config = null, Structure $state = null, mixed $source = null)

Instantiate the model.

mixed
__call(string $name, array $args = array())

__call

Structure
getConfig()

Method to get property Config

setConfig(Structure $config)

Method to set property config

string
getName()

Method to get property Name

setName(string $name)

Method to set property name

string
getCacheId(string $id = null)

getStoredId

Structure
getState()

Get the model state.

void
setState(Structure $state)

Set the model state.

mixed
get(string $key, mixed $default = null)

get

$this
set(string $key, mixed $value)

set

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.

Structure
__get(string $name)

__get

Details

static SingletonTrait getInstance(array $args)

getInstance

Parameters

array $args

Return Value

SingletonTrait

static mixed setInstance(object $instance)

setInstance

Parameters

object $instance

Return Value

mixed

at line line 84
__construct(Structure|array $config = null, Structure $state = null, mixed $source = null)

Instantiate the model.

Parameters

Structure|array $config The model config.
Structure $state The model state.
mixed $source The data source.

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

__call

Parameters

string $name
array $args

Return Value

mixed

Exceptions

InvalidArgumentException

at line line 145
Structure getConfig()

Method to get property Config

Return Value

Structure

at line line 157
ModelRepository setConfig(Structure $config)

Method to set property config

Parameters

Structure $config

Return Value

ModelRepository Return self to support chaining.

at line line 169
string getName()

Method to get property Name

Return Value

string

at line line 195
ModelRepository setName(string $name)

Method to set property name

Parameters

string $name

Return Value

ModelRepository Return self to support chaining.

at line line 209
string getCacheId(string $id = null)

getStoredId

Parameters

string $id

Return Value

string

at line line 260
ModelRepository resetCache()

resetCache

Return Value

ModelRepository

at line line 285
Structure getState()

Get the model state.

Return Value

Structure The state object.

at line line 297
void setState(Structure $state)

Set the model state.

Parameters

Structure $state The state object.

Return Value

void

at line line 310
mixed get(string $key, mixed $default = null)

get

Parameters

string $key
mixed $default

Return Value

mixed

at line line 323
$this set(string $key, mixed $value)

set

Parameters

string $key
mixed $value

Return Value

$this

at line line 335
ModelRepository reset()

reset

Return Value

ModelRepository

at line line 349
boolean offsetExists(mixed $offset)

Is a property exists or not.

Parameters

mixed $offset Offset key.

Return Value

boolean

at line line 362
mixed offsetGet(mixed $offset)

Get a property.

Parameters

mixed $offset Offset key.

Return Value

mixed The value to return.

Exceptions

InvalidArgumentException

at line line 376
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 389
void offsetUnset(mixed $offset)

Unset a property.

Parameters

mixed $offset Offset key to unset.

Return Value

void

Exceptions

InvalidArgumentException

at line line 401
Structure __get(string $name)

__get

Parameters

string $name

Return Value

Structure