Stud.IP  5.4
Semester Class Reference
Inheritance diagram for Semester:
SimpleORMap

Public Member Functions

 getFirstSemesterWeek ()
 
 getLastSemesterWeek ()
 
 isPast ()
 
 isCurrent ()
 
 getStartWeeks (?Semester $end_semester=null)
 
 getCorrectedLectureBegin ()
 
 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)
 
 isRelation ($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 findPrevious ($timestamp=null)
 
static findCurrent ()
 
static findAllVisible ($with_before_first=true)
 
static getAll ($force_reload=false)
 
static getAllAsArray ($with_before_first=true, $force_reload=false)
 
static getIndexById ($semester_id, $with_before_first=true, $only_visible=false)
 
static getSemesterSelector ( $select_attributes=null, $default=0, $option_value='semester_id', $include_all=true, $use_semester_id=true)
 
static getSemChangeDate ($semester)
 
static findDefault ()
 
- Static Public Member Functions inherited from SimpleORMap
static tableScheme ($db_table)
 
static expireTableScheme ()
 
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 (string $name, array $arguments)
 

Protected Member Functions

 seminarCounter ($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)
 
 cbNotificationMapper ($cb_type)
 
 cbAfterInitialize ($cb_type)
 
 setSerializedValue ($field, $value)
 
 setI18nValue ($field, $value)
 

Static Protected Member Functions

static configure ($config=[])
 
- Static Protected Member Functions inherited from SimpleORMap
static db_table ()
 
static db_fields ()
 
static pk ()
 
static default_values ()
 
static serialized_fields ()
 
static alias_fields ()
 
static i18n_fields ()
 
static additional_fields ()
 
static has_many ()
 
static has_one ()
 
static belongs_to ()
 
static has_and_belongs_to_many ()
 
static registered_callbacks ()
 
static known_slots ()
 
static notification_map ()
 
static getter_setter_map ()
 
static configure ($config=[])
 
static config ($key)
 
static registerCallback ($types, $cb)
 
static unregisterCallback ($types, $cb)
 

Protected Attributes

 $seminar_counts = null
 
- Protected Attributes inherited from SimpleORMap
 $content = []
 
 $content_db = []
 
 $is_new = true
 
 $is_deleted = false
 
 $relations = []
 
 $additional_data = []
 

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']
 
static $performs_batch_operation = false
 

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

◆ findAllVisible()

static findAllVisible (   $with_before_first = true)
static

Return a specially orderd array of all semesters

◆ findByTimestamp()

static findByTimestamp (   $timestamp)
static

returns Semester for given timestamp

Parameters
integer$timestamp
Returns
null|Semester

◆ findCurrent()

static findCurrent ( )
static

returns current Semester

◆ findDefault()

static findDefault ( )
static

◆ findNext()

static findNext (   $timestamp = null)
static

returns following Semester for given timestamp

Parameters
integer$timestamp
Returns
null|Semester

◆ findPrevious()

static findPrevious (   $timestamp = null)
static

Returns the previous semester for a semester specified by a timestamp. If no timestamp is specified, the previous semester of the current semester is returned.

Parameters
integer | null$timestampThe timestamp of the semester whose predecessor shall be found. Defaults to null.
Returns
null|Semester A previous semester to the specified one or null, if no such semester could be found.

◆ getAll()

static getAll (   $force_reload = false)
static

returns array of all existing semester objects orderd by begin

Parameters
boolean$force_reload
Returns
array

◆ 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

◆ getCorrectedLectureBegin()

getCorrectedLectureBegin ( )

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

◆ getFirstSemesterWeek()

getFirstSemesterWeek ( )

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

Returns
int Calendar week number of the first week of lecture

◆ getIndexById()

static getIndexById (   $semester_id,
  $with_before_first = true,
  $only_visible = false 
)
static

returns the index for a given semester id, in an array returned from self::getAllAsArray(), beware of second parameter

Parameters
$semester_id
bool$with_before_first
bool$only_visible
Returns
bool|int

◆ getLastSemesterWeek()

getLastSemesterWeek ( )

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

Returns
int Calendar week number of the last week of lecture

◆ getSemChangeDate()

static getSemChangeDate (   $semester)
static

◆ getSemesterSelector()

static getSemesterSelector (   $select_attributes = null,
  $default = 0,
  $option_value = 'semester_id',
  $include_all = true,
  $use_semester_id = true 
)
static

Returns an html fragment with a semester select-box

Parameters
array$select_attributes
integer$default
string$option_value
boolean$include_all
boolean$use_semester_id
Returns
string

◆ getSemWeekNumber()

getSemWeekNumber (   $timestamp)

returns "Semesterwoche" for a given timestamp

Parameters
integer$timestamp
Returns
number|boolean

◆ getStartWeeks()

getStartWeeks ( ?Semester  $end_semester = null)

Returns the start week dates for this semester (and other semesters if $end_semester is given).

Parameters
Semester$end_semesterend semester, default is $this
Returns
array containing the start weeks

◆ isCurrent()

isCurrent ( )

Returns whether this semester is the current semester.

Returns
bool Indicating if this is the current semester

◆ isPast()

isPast ( )

Return whether this semester is in the past.

Returns
bool Indicating whether this semester is in the past

◆ refreshCache()

refreshCache ( )

Flushes the cache just after storing and deleting a semester

◆ seminarCounter()

seminarCounter (   $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

◆ 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: