Public Member Functions | Static Public Member Functions | Protected Attributes

ControlStorage Class Reference

Inheritance diagram for ControlStorage:
Collaboration diagram for ControlStorage:

List of all members.

Public Member Functions

 __construct ($load, $save)
 from_object_parameter ($obj, $parameter)
 field_save ($key, $value)
 field_load ($key)

Static Public Member Functions

static from_storage_string ($value)

Protected Attributes

 $saver
 $loader

Detailed Description

Definition at line 5 of file controlstorage.php.


Constructor & Destructor Documentation

ControlStorage::__construct ( load,
save 
)

Construct a basic FormStorage object

Parameters:
Callable|string $load A function to call to load the control value, OR a non-callable
$save 

Definition at line 17 of file controlstorage.php.


Member Function Documentation

ControlStorage::field_load ( key  ) 

Loads form values from an object

Parameters:
string $key The name of a form component that will be loaded
Returns:
mixed The stored value returned

Implements FormStorage.

Definition at line 127 of file controlstorage.php.

ControlStorage::field_save ( key,
value 
)

Stores a form value into the object

Parameters:
string $key The name of a form component that will be stored
mixed $value The value of the form component to store

Implements FormStorage.

Definition at line 116 of file controlstorage.php.

ControlStorage::from_object_parameter ( obj,
parameter 
)

Create a new ControlStorage instance to save/load a control value from the parameter of a particular object

Parameters:
Object $obj The object that will be saved to or loaded from
string $parameter The name of a parameter on the object that will be used for storage
Returns:
ControlStorage An instance of a ControlStorage object that will load/save to the specified location

Definition at line 97 of file controlstorage.php.

static ControlStorage::from_storage_string ( value  )  [static]

Produce a basic FormStorage implementation from a classic storage string

Parameters:
string $value A classic storage string, such as "option:someoption" or "user:age"
Returns:
ControlStorage An instance of an object that will save and load to the indicated location

Definition at line 27 of file controlstorage.php.

Referenced by FormControl::set_storage().


The documentation for this class was generated from the following file: