FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Vars Class Reference

Variables component (dynamic configuration). More...

Inheritance diagram for Vars:
Component Thing

Public Member Functions

 value ($key, $time=null)
 Retrieve a value. More...
 
 add ($key, $value, $start=null)
 Add a value. More...
 
 categories ()
 All categories. More...
 
 items ($category)
 All config items for a category. More...
 
- Public Member Functions inherited from Component
 __construct ($fred, $config=null)
 
 __destruct ()
 
 clientConfig ()
 Public configuration. More...
 
 config ($key, $default=null)
 Retrieve a config value. More...
 
 ping ()
 Ping function. More...
 
 filemtime ($filename)
 Filemtime with session cache. More...
 
 component ($name)
 Get a component (local or default). More...
 
 components (... $names)
 Get multiple components in an array. More...
 
- Public Member Functions inherited from Thing
 propertyExists ($property)
 Check if a property exists (public or published). More...
 
 constants ($prefix=null)
 Return all constants. More...
 
 get ($key)
 Get one or more properties. More...
 
 set ($key, $value=null)
 Set one or more properties. More...
 
 __get ($key)
 
 __set ($key, $value)
 

Data Fields

 $lockItem = 'variables'
 
- Data Fields inherited from Component
 $filemtimeTtl = 0
 
- Data Fields inherited from Thing
const HIDDEN = 0
 Property is hidden. More...
 
const READABLE = 1
 Property is readable. More...
 
const WRITEABLE = 2
 Property is writeable. More...
 
const READWRITE = 3
 Property is readable and writeable. More...
 

Protected Member Functions

 getItems ()
 
 _get ($key)
 
 _set ($key, $value)
 
- Protected Member Functions inherited from Component
 init ()
 
 done ()
 
 getSession ()
 
- Protected Member Functions inherited from Thing
 publish ($property, $visibility=self::READABLE)
 Publish a property (or hide it again). More...
 
 configure ($config)
 Configure the object. More...
 
 _get ($key)
 Default getter if no specific setter is defined, and the property is also not published (readable). More...
 
 _set ($key, $value)
 Default setter if no specific setter is defined, and the property is also not published (writeable). More...
 

Protected Attributes

 $_filename = null
 Storage file (JSON formatted). More...
 
 $_items = null
 
- Protected Attributes inherited from Component
 $_fred = null
 
 $_config = null
 
 $_name = null
 
 $_components = []
 Local components (key = component name, value = component). More...
 
 $_session = null
 
- Protected Attributes inherited from Thing
 $_published = []
 Published properties (key = name of property, value = visibility). More...
 

Detailed Description

Variables component (dynamic configuration).

Definition at line 8 of file Vars.php.

Member Function Documentation

◆ _get()

_get (   $key)
protected

Definition at line 88 of file Vars.php.

◆ _set()

_set (   $key,
  $value 
)
protected

Definition at line 92 of file Vars.php.

◆ add()

add (   $key,
  $value,
  $start = null 
)

Add a value.

Parameters
string$key
mixed$value
int$startTime from when on the value is to be used (null = now).
Returns
bool True on success.

Definition at line 37 of file Vars.php.

◆ categories()

categories ( )

All categories.

Returns
array Key = category, value = needed right for editing.

Definition at line 60 of file Vars.php.

◆ getItems()

getItems ( )
protected

Definition at line 79 of file Vars.php.

◆ items()

items (   $category)

All config items for a category.

Parameters
string$category
Returns
array Key = item key, value = edit mask (reg-exp or widget params).

Definition at line 72 of file Vars.php.

◆ value()

value (   $key,
  $time = null 
)

Retrieve a value.

Parameters
string$key
string$timeTime for historic value (empty = current).
Returns
mixed Value (false = not found).

Definition at line 22 of file Vars.php.

Field Documentation

◆ $_filename

$_filename = null
protected

Storage file (JSON formatted).

Definition at line 12 of file Vars.php.

◆ $_items

$_items = null
protected

Definition at line 14 of file Vars.php.

◆ $lockItem

$lockItem = 'variables'

Definition at line 10 of file Vars.php.


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