Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
VisibilitySettings Class Reference

Public Member Functions

 __construct ()
 
 verify ($user_id, $owner_id, $visibility)
 
 getDescription ($stateid)
 
 getAllKeys ()
 
 getAllNames ()
 
 count ()
 

Static Public Member Functions

static getInstance ()
 

Data Fields

 $states = []
 

Static Public Attributes

static $CLASSES
 

Detailed Description

Groups all visibilitySettings

Constructor & Destructor Documentation

__construct ( )

On first construct we scan the visibilitySettings folder and load all applied visibilitySettings

Member Function Documentation

count ( )

Returns the number of possible states

Returns
type
getAllKeys ( )

Returns all keys of states

Returns
array all keys of states
getAllNames ( )

Returns all names of states

Returns
array all names of states
getDescription (   $stateid)

Get Description of a specific state

Parameters
int$stateidthe int representation
Returns
string State description
static getInstance ( )
static

I/O is expensive. Therefore we make the whole class sessionwide singleton to save some I/O.

Returns
VisibilitySettings The sessionwide visibilitySettings
verify (   $user_id,
  $owner_id,
  $visibility 
)

Passthrou to the specified verify method

Parameters
string$user_idThe userid
string$owner_idThe owner of the visibility
int$visibilitythe visibilityID
Returns
boolean true if the user may see it, false if the user is not allowed to see

Field Documentation

$CLASSES
static
Initial value:
= [
'Visibility_Me',
'Visibility_Buddies',
'Visibility_Domain',
'Visibility_Studip',
'Visibility_Extern'
]
$states = []

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