Stud.IP  4.2 Revision
Config Class Reference
Inheritance diagram for Config:
Inheritance graph
Collaboration diagram for Config:
Collaboration graph

Public Member Functions

 __construct ($data=null)
 
 getFields ($range=null, $section=null, $name=null)
 
 getMetadata ($field)
 
 getValue ($field)
 
 setValue ($field, $value)
 
 getIterator ()
 
 __get ($field)
 
 __set ($field, $value)
 
 __isset ($field)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 count ()
 
 store ($field, $data)
 
 create ($field, $data=array())
 
 delete ($field)
 

Static Public Member Functions

static get ()
 
static getInstance ()
 
static set ()
 

Protected Member Functions

 fetchData ($data=null)
 

Protected Attributes

 $data = array()
 
 $metadata = array()
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $data = null)

pass array of config entries in field => value pairs to circumvent fetching from database

Parameters
array$data
Here is the call graph for this function:

Member Function Documentation

◆ __get()

__get (   $field)

magic method for dynamic properties

Here is the call graph for this function:

◆ __isset()

__isset (   $field)

magic method for dynamic properties

◆ __set()

__set (   $field,
  $value 
)

magic method for dynamic properties

Here is the call graph for this function:

◆ count()

count ( )

◆ create()

create (   $field,
  $data = array() 
)

creates a new config entry in database

Parameters
stringname of entry
arraydata to insert as assoc array
Exceptions
InvalidArgumentException
Returns
Ambigous <NULL, ConfigEntry>
Here is the call graph for this function:

◆ delete()

delete (   $field)

delete config entry from database

Parameters
stringname of entry
Exceptions
InvalidArgumentException
Returns
integer number of deleted rows
Here is the call graph for this function:

◆ fetchData()

fetchData (   $data = null)
protected

fetch config data from table config pass array to override database access

Parameters
array$data
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get()

static get ( )
static

returns singleton instance

Returns
Config

◆ getFields()

getFields (   $range = null,
  $section = null,
  $name = null 
)

returns a list of config entry names, filtered by given params

Parameters
stringfilter by range: global or user
stringfilter by section
stringfilter by part of name
Returns
array
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInstance()

static getInstance ( )
static

alias of Config::get() for compatibility

Returns
Config
Here is the caller graph for this function:

◆ getIterator()

getIterator ( )

◆ getMetadata()

getMetadata (   $field)

returns metadata for config entry

Parameters
srting$field
Returns
array

◆ getValue()

getValue (   $field)

returns value of config entry for compatibility reasons an existing variable in global namespace with the same name is also returned

Parameters
string$field
Returns
Ambigous
Here is the caller graph for this function:

◆ offsetExists()

offsetExists (   $offset)

ArrayAccess: Check whether the given offset exists.

◆ offsetGet()

offsetGet (   $offset)

ArrayAccess: Get the value at the given offset.

◆ offsetSet()

offsetSet (   $offset,
  $value 
)

ArrayAccess: Set the value at the given offset.

◆ offsetUnset()

offsetUnset (   $offset)

ArrayAccess: unset the value at the given offset (not applicable)

◆ set()

static set ( )
static

use to set singleton instance for testing or to unset by passing null

Parameters
Config$my_instance
Here is the caller graph for this function:

◆ setValue()

setValue (   $field,
  $value 
)

set config entry to given value, but don't store it in database

Parameters
string$field
unknown_type$value
Returns
Here is the caller graph for this function:

◆ store()

store (   $field,
  $data 
)

store new value for existing config entry in database posts notification ConfigValueChanged if entry is changed

Parameters
string$field
string$data
Exceptions
InvalidArgumentException
Returns
boolean
Here is the call graph for this function:

Field Documentation

◆ $data

$data = array()
protected

◆ $metadata

$metadata = array()
protected

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