vB_Context
in package
Uses
vB_Trait_NoSerialize
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.
Tags
Table of Contents
Methods
- __construct() : mixed
- Constructor.
- __serialize() : array<string|int, mixed>
- __set() : mixed
- Setter for defining the context characteristics.
- __sleep() : array<string|int, mixed>
- __toString() : string
- __toString Returns the evaluated context id.
- __unserialize() : void
- __wakeup() : void
- getId() : string
- Gets an individual id for the context.
Methods
__construct()
Constructor.
public
__construct([mixed $key = false ][, mixed $values = false ]) : mixed
Allows values to be given as an array on instantiation.
Parameters
- $key : mixed = false
- $values : mixed = false
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__set()
Setter for defining the context characteristics.
public
__set(string $property, mixed $value) : mixed
Parameters
- $property : string
-
- The property id
- $value : mixed
-
- The value to set
__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__toString()
__toString Returns the evaluated context id.
public
__toString() : string
Return values
string__unserialize()
public
__unserialize(array<string|int, mixed> $serialized) : void
Parameters
- $serialized : array<string|int, mixed>
__wakeup()
public
__wakeup() : void
getId()
Gets an individual id for the context.
public
getId() : string