Свойство | Тип | Описание | |
---|---|---|---|
$loader | Callable | string | A function that loads this control value | |
$saver | Callable | string | A fucntion that saves this control value |
Метод | Описание | |
---|---|---|
__construct ( Callable | string $load, $save ) | Construct a basic FormStorage object | |
field_load ( string $key ) : mixed | Loads form values from an object | |
field_save ( string $key, mixed $value ) | Stores a form value into the object | |
from_object_parameter ( Object $obj, string $parameter ) : |
Create a new ControlStorage instance to save/load a control value from the parameter of a particular object | |
from_storage_string ( string $value ) : |
Produce a basic FormStorage implementation from a classic storage string |
public __construct ( Callable | string $load, $save ) | ||
$load | Callable | string | A function to call to load the control value, OR a non-callable |
$save |
public field_load ( string $key ) : mixed | ||
$key | string | The name of a form component that will be loaded |
Результат | mixed | The stored value returned |
public field_save ( string $key, mixed $value ) | ||
$key | string | The name of a form component that will be stored |
$value | mixed | The value of the form component to store |
public from_object_parameter ( Object $obj, string $parameter ) : |
||
$obj | Object | The object that will be saved to or loaded from |
$parameter | string | The name of a parameter on the object that will be used for storage |
Результат | An instance of a ControlStorage object that will load/save to the specified location |
public static from_storage_string ( string $value ) : |
||
$value | string | A classic storage string, such as "option:someoption" or "user:age" |
Результат | An instance of an object that will save and load to the indicated location |
protected Callable|string $loader | ||
Результат | Callable | string |
protected Callable|string $saver | ||
Результат | Callable | string |