Stud.IP  5.4
SemType Class Reference
Inheritance diagram for SemType:

Public Member Functions

 __construct ($data)
 
 countSeminars ()
 
 store ()
 
 delete ()
 
 set ($offset, $value)
 
 getClass ()
 
 offsetSet ($offset, $value)
 
 offsetGet ($offset)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 

Static Public Member Functions

static getTypes ()
 
static refreshTypes ()
 
static getGroupingSemTypes ()
 
static getNonGroupingSemTypes ()
 

Protected Attributes

 $data = []
 

Static Protected Attributes

static $sem_types = null
 

Detailed Description

Class to define and manage attributes of seminar types. Usually all sem-types are stored in a global variable $SEM_TYPE which is an array of SemType objects.

SemType::getTypes() gets you all seminar types in an array.

This class only represents the name of the type and gives a relation to a sem_class.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $data)

Constructor can be set with integer of sem_class_id or an array of the old $SEM_CLASS style.

Parameters
integer  |  array$data

Member Function Documentation

◆ countSeminars()

countSeminars ( )

Returns the number of seminars of this sem_type in Stud.IP

Returns
integer

◆ delete()

delete ( )

Deletes the sem_type-object. Will only delete, if there are no seminars in this sem_type. Remember to refresh the global $SEM_TYPE array.

Returns
boolean : success of deletion

◆ getClass()

getClass ( )

◆ getGroupingSemTypes()

static getGroupingSemTypes ( )
static

Gets all SemTypes that are allowed as group parents.

Returns
array

◆ getNonGroupingSemTypes()

static getNonGroupingSemTypes ( )
static

Gets all SemTypes that are allowed as group parents.

Returns
array

◆ getTypes()

static getTypes ( )
static

Returns an array of all SemTypes in Stud.IP. Equivalent to global $SEM_TYPE variable. This variable is statically stored in this class.

Returns
array of SemType

◆ offsetExists()

offsetExists (   $offset)

ArrayAccess method to check if an attribute exists.

Parameters
mixed$offset
Returns
bool

◆ offsetGet()

offsetGet (   $offset)

Compatibility function with old $SEM_TYPE variable for plugins. Maps the new array-structure to the old boolean values.

Parameters
integer$offset,name of attribute
Returns
boolean|(localized)string

◆ offsetSet()

offsetSet (   $offset,
  $value 
)

deprecated, does nothing, should not be used

Parameters
string$offset
mixed$value

◆ offsetUnset()

offsetUnset (   $offset)

deprecated, does nothing, should not be used

Parameters
string$offset

◆ refreshTypes()

static refreshTypes ( )
static

◆ set()

set (   $offset,
  $value 
)

Sets an attribute of sem_type->data

Parameters
string$offset
mixed$value

◆ store()

store ( )

stores all data in the database

Returns
boolean success

Field Documentation

◆ $data

$data = []
protected

◆ $sem_types

$sem_types = null
staticprotected

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