Stud.IP  trunk Revision
Semester Class Reference
Inheritance diagram for Semester:
Inheritance graph
Collaboration diagram for Semester:
Collaboration graph

Public Member Functions

 getfirst_sem_week ()
 
 getlast_sem_week ()
 
 getpast ()
 
 getcurrent ()
 
 getStartWeeks ($duration=false)
 
 getCorrectedVorlesBegin ()
 
 getSemWeekNumber ($timestamp)
 
 toArray ($only_these_fields=null)
 
 refreshCache ()
 
- Public Member Functions inherited from SimpleORMap
 __construct ($id=null)
 
 __clone ()
 
 getRelationOptions ($relation)
 
 getTableMetadata ()
 
 hasAutoIncrementColumn ()
 
 setId ($id)
 
 getId ()
 
 getNewId ()
 
 toArray ($only_these_fields=null)
 
 toRawArray ($only_these_fields=null)
 
 toArrayRecursive ($only_these_fields=null)
 
 getValue ($field)
 
 getRelationValue ($relation, $field)
 
 getDefaultValue ($field)
 
 setValue ($field, $value)
 
 __get ($field)
 
 __set ($field, $value)
 
 __isset ($field)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 getIterator ()
 
 count ()
 
 isField ($field)
 
 isAdditionalField ($field)
 
 isAliasField ($field)
 
 isI18nField ($field)
 
 setData ($data, $reset=false)
 
 isNew ()
 
 isDeleted ()
 
 setNew ($is_new)
 
 getWhereQuery ()
 
 restore ()
 
 store ()
 
 triggerChdate ()
 
 delete ()
 
 isDirty ()
 
 isFieldDirty ($field)
 
 revertValue ($field)
 
 getPristineValue ($field)
 
 initRelation ($relation)
 
 resetRelation ($relation)
 
 cleanup ()
 

Static Public Member Functions

static find ($id)
 
static findByTimestamp ($timestamp)
 
static findNext ($timestamp=null)
 
static findCurrent ()
 
static getAll ($force_reload=false)
 
static getAllAsArray ($with_before_first=true, $force_reload=false)
 
- Static Public Member Functions inherited from SimpleORMap
static tableScheme ($db_table)
 
static expireTableScheme ()
 
static find ($id)
 
static exists ($id)
 
static countBySql ($sql=1, $params=[])
 
static create ($data)
 
static build ($data, $is_new=true)
 
static buildExisting ($data)
 
static import ($data)
 
static findBySQL ($sql, $params=[])
 
static findOneBySQL ($where, $params=[])
 
static findThru ($foreign_key_value, $options)
 
static findEachBySQL ($callable, $sql, $params=[])
 
static findMany ($pks=[], $order='', $order_params=[])
 
static findEachMany ($callable, $pks=[], $order='', $order_params=[])
 
static findAndMapBySQL ($callable, $where, $params=[])
 
static findAndMapMany ($callable, $pks=[], $order='', $order_params=[])
 
static deleteBySQL ($where, $params=[])
 
static toObject ($id_or_object)
 
static __callStatic ($name, $arguments)
 

Protected Member Functions

 seminar_counter ($field)
 
- Protected Member Functions inherited from SimpleORMap
 _getId ($field)
 
 _setId ($field, $value)
 
 _getAdditionalValueFromRelation ($field)
 
 _setAdditionalValueFromRelation ($field, $value)
 
 _getAdditionalValue ($field)
 
 _setAdditionalValue ($field, $value)
 
 parseRelationOptions ($type, $name, $options)
 
 storeRelations ($only_these=null)
 
 deleteRelations ()
 
 initializeContent ()
 
 applyCallbacks ($type)
 
 registerCallback ($types, $cb)
 
 unregisterCallback ($types, $cb)
 
 cbAutoIncrementColumn ($type)
 
 cbAutoKeyCreation ()
 
 cbNotificationMapper ($cb_type)
 
 cbAfterInitialize ($cb_type)
 
 setSerializedValue ($field, $value)
 
 setI18nValue ($field, $value)
 
 cbI18N ($type)
 

Static Protected Member Functions

static configure ($config=[])
 
- Static Protected Member Functions inherited from SimpleORMap
static configure ($config=[])
 
static config ($key)
 

Protected Attributes

 $seminar_counts = null
 
- Protected Attributes inherited from SimpleORMap
 $content = []
 
 $content_db = []
 
 $is_new = true
 
 $is_deleted = false
 
 $db_table = ''
 
 $db_fields = null
 
 $pk = null
 
 $default_values = []
 
 $serialized_fields = []
 
 $alias_fields = []
 
 $i18n_fields = []
 
 $additional_fields = []
 
 $relations = []
 
 $has_many = []
 
 $has_one = []
 
 $belongs_to = []
 
 $has_and_belongs_to_many = []
 
 $registered_callbacks = []
 
 $known_slots = []
 
 $notification_map = []
 
 $additional_data = []
 
 $getter_setter_map = []
 

Additional Inherited Members

- Data Fields inherited from SimpleORMap
const ID_SEPARATOR = '_'
 
- Static Public Attributes inherited from SimpleORMap
static $schemes = null
 
- Static Protected Attributes inherited from SimpleORMap
static $config = []
 
static $reserved_slots = ['value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id']
 

Member Function Documentation

◆ configure()

static configure (   $config = [])
staticprotected

Configures this model.

Parameters
Array$config

◆ find()

static find (   $id)
static

returns semester object for given id or null

Parameters
string$id
Returns
NULL|Semester
Here is the caller graph for this function:

◆ findByTimestamp()

static findByTimestamp (   $timestamp)
static

returns Semester for given timestamp

Parameters
integer$timestamp
Returns
null|Semester
Here is the caller graph for this function:

◆ findCurrent()

static findCurrent ( )
static

returns current Semester

Here is the caller graph for this function:

◆ findNext()

static findNext (   $timestamp = null)
static

returns following Semester for given timestamp

Parameters
integer$timestamp
Returns
null|Semester
Here is the caller graph for this function:

◆ getAll()

static getAll (   $force_reload = false)
static

returns array of all existing semester objects orderd by begin

Parameters
boolean$force_reload
Returns
array
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAllAsArray()

static getAllAsArray (   $with_before_first = true,
  $force_reload = false 
)
static

Returns a list of all semesters as array, optionally with an entry at the beginning that represents the time before the first semester in the system.

Parameters
boolean$with_before_firstShow the optional first entry as described above
boolean$force_reload
Returns
array
Here is the caller graph for this function:

◆ getCorrectedVorlesBegin()

getCorrectedVorlesBegin ( )

Returns the corrected begin of lectures which ensures that the begin is always on a monday.

Returns
int unix timestamp of correct begin of lectures
Here is the caller graph for this function:

◆ getcurrent()

getcurrent ( )

Returns whether this semester is the current semester.

Returns
bool Indicating if this is the current semester

◆ getfirst_sem_week()

getfirst_sem_week ( )

Returns the calendar week number of the first week of the lecture period.

Returns
int Calendar week number of the first week of lecture

◆ getlast_sem_week()

getlast_sem_week ( )

Returns the calendar week number of the last week of the lecture period.

Returns
int Calendar week number of the last week of lecture

◆ getpast()

getpast ( )

Return whether this semester is in the past.

Returns
bool Indicating whether this semester is in the past

◆ getSemWeekNumber()

getSemWeekNumber (   $timestamp)

returns "Semesterwoche" for a given timestamp

Parameters
integer$timestamp
Returns
number|boolean

◆ getStartWeeks()

getStartWeeks (   $duration = false)

Returns the start week dates for this semester (and other semesters if duration is > 0).

Parameters
mixed$durationDuration time (false to restrict to current semester, -1 for indefinite duration, otherwise the int value for the duration so that semester start + duration = end)
Returns
array containing the start weeks
Here is the call graph for this function:

◆ refreshCache()

refreshCache ( )

Flushes the cache just after storing and deleting a semester

Here is the call graph for this function:

◆ seminar_counter()

seminar_counter (   $field)
protected

Counts the number of different seminar types in this semester. This method caches the result in $seminar_counts so the db will only be queried once per semester.

Parameters
String$fieldName of the seminar (/additional_fields) type
Returns
int The count of seminars of this type
Here is the call graph for this function:

◆ toArray()

toArray (   $only_these_fields = null)

Returns an array representation of this semester.

Parameters
mixed$only_these_fieldsList of fields to extract
Returns
array represenation

Field Documentation

◆ $seminar_counts

$seminar_counts = null
protected

Caches seminar counts


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