Stud.IP  2.0 Revision 48548
 All Data Structures Namespaces Files Functions Variables Pages
UserConfig Class Reference
Inheritance diagram for UserConfig:
Inheritance graph
Collaboration diagram for UserConfig:
Collaboration graph

Public Member Functions

 __construct ($user_id=null, $data=null)
 setUserId ($user_id)
 getUserId ()
 getValue ($field)
 setValue ($field, $value)
 unsetValue ($field)
 store ($field, $value)
 delete ($field)
- Public Member Functions inherited from Config
 __construct ($data=null)
 extractAllGlobal ()
 getFields ($range=null, $section=null, $name=null)
 getMetadata ($field)
 getIterator ()
 __get ($field)
 __set ($field, $value)
 __isset ($field)
 offsetExists ($offset)
 offsetGet ($offset)
 offsetSet ($offset, $value)
 offsetUnset ($offset)
 count ()
 create ($field, $data=array())

Static Public Member Functions

static get ($user_id)
static set ($user_id, $my_instance)
- Static Public Member Functions inherited from Config
static get ()
static getInstance ()
static set ($my_instance)

Protected Member Functions

 fetchData ($data=null)

Additional Inherited Members

- Protected Attributes inherited from Config
 $data = array()
 $metadata = array()

Constructor & Destructor Documentation

__construct (   $user_id = null,
  $data = null 
)

passing null as first param is for compatibility and should be considered deprecated. passing data array as second param only for testing

Parameters
string$user_id
array$data

Here is the call graph for this function:

Member Function Documentation

delete (   $field)

delete config entry from database

Parameters
stringname of entry
Exceptions
InvalidArgumentException
Returns
integer number of deleted rows

Reimplemented from Config.

Here is the call graph for this function:

fetchData (   $data = null)
protected

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

Parameters
array$data

Reimplemented from Config.

Here is the call graph for this function:

Here is the caller graph for this function:

static get (   $user_id)
static

returns cached instance for given user_id creates new objects if needed

Parameters
string$user_id
Returns
UserConfig
getUserId ( )

returns the user id

Returns
string
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

Reimplemented from Config.

Here is the call graph for this function:

static set (   $user_id,
  $my_instance 
)
static

set cached instance for given user_id use for testing or to unset cached instance by passing null as second param

Parameters
string$user_id
UserConfig$my_instance
setUserId (   $user_id)

kept for compatibility, should be private

Deprecated:
Parameters
string$user_id

Here is the call graph for this function:

Here is the caller graph for this function:

setValue (   $field,
  $value 
)

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

Parameters
string$field
unknown_type$value
Returns

Reimplemented from Config.

Here is the call graph for this function:

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

Reimplemented from Config.

Here is the call graph for this function:

Here is the caller graph for this function:

unsetValue (   $field)

old style usage with $user_id, $key as params still works but is deprecated

Parameters
string$field
Returns
bool

Here is the call graph for this function:


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