class vB_Context

Context Container for information about a context that can be serialized and used as an id to determine whether other data or methods are applicable.

This is useful for both caching and state management. A context can be created to retrieve an appropriate cache object or managed state value. The context can be hashed providing a context value for testing.

Values can be set in any order as they will be sorted for integrity before hashing the context id.

Traits

Methods

__sleep()

No description

__wakeup()

No description

__construct($key = false, $values = false)

Constructor.

__set(string $property, mixed $value)

Setter for defining the context characteristics.

string
getId()

Gets an individual id for the context.

string
__toString()

__toString Returns the evaluated context id.

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 89
__construct($key = false, $values = false)

Constructor.

Allows values to be given as an array on instantiation.

Parameters

$key
$values

at line 109
__set(string $property, mixed $value)

Setter for defining the context characteristics.

Parameters

string $property
  • The property id
mixed $value
  • The value to set

at line 125
string getId()

Gets an individual id for the context.

Return Value

string

at line 155
string __toString()

__toString Returns the evaluated context id.

Return Value

string