Stud.IP  5.4
Course Class Reference
Inheritance diagram for Course:
SimpleORMap Range PrivacyObject StudipItem FeedbackRange Owner

Public Member Functions

 getEnd_Time ()
 
 setEnd_Time ($value)
 
 _set_semester ($field, $value)
 
 setStartSemester (Semester $semester)
 
 setEndSemester (?Semester $semester)
 
 getStartSemester ()
 
 getEndSemester ()
 
 getTextualSemester ()
 
 isOpenEnded ()
 
 isInSemester (Semester $semester)
 
 getTeachers ()
 
 getFreeSeats ()
 
 isWaitlistAvailable ()
 
 getMembersWithStatus ($status, $as_collection=false)
 
 countMembersWithStatus ($status)
 
 getNumParticipants ()
 
 getNumPrelimParticipants ()
 
 getNumWaiting ()
 
 getParticipantStatus ($user_id)
 
 getSemType ()
 
 getSemClass ()
 
 getFullName ($format='default')
 
 getDatesWithExdates ($range_begin=0, $range_end=0)
 
 setStudyAreas ($ids)
 
 isVisibleForUser ($user_id=null)
 
 describeRange ()
 
 getRangeType ()
 
 getRangeId ()
 
 getConfiguration ()
 
 isAccessibleToUser ($user_id=null)
 
 isEditableByUser ($user_id=null)
 
 getCompletionIcon ()
 
 getCompetionLabel ()
 
 cbSetStartAndDurationTime ()
 
 getItemName ($long_format=true)
 
 getItemURL ()
 
 getItemAvatarURL ()
 
 getRangeName ()
 
 getRangeIcon ($role)
 
 getRangeUrl ()
 
 getRangeCourseId ()
 
 isRangeAccessible (string $user_id=null)
 
 getLink ()
 
 isStudygroup ()
 
 setDefaultTools ()
 
 isToolActive ($name)
 
 getActivatedTools ()
 
 __toString ()
 
 isCalendarReadable (?string $user_id=null)
 
 isCalendarWritable (string $user_id=null)
 
 getMembersData (?string $status='')
 
- 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 ()
 
- Public Member Functions inherited from FeedbackRange
 getId ()
 
- Public Member Functions inherited from Owner
 isCalendarWritable (?string $user_id=null)
 

Static Public Member Functions

static findCurrent ()
 
static getMVVModulesForCourseId (string $course_id, ?array $statusses=null)
 
static exportUserData (StoredUserData $storage)
 
static findByUser ($user_id, $perms=[], $with_deputies=true)
 
static getCalendarOwner (string $owner_id)
 
- 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

 logStore ()
 
- 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)
 

Additional Inherited Members

- Data Fields inherited from SimpleORMap
const ID_SEPARATOR = '_'
 
- Static Public Attributes inherited from SimpleORMap
static $schemes = null
 
- Protected Attributes inherited from SimpleORMap
 $content = []
 
 $content_db = []
 
 $is_new = true
 
 $is_deleted = false
 
 $relations = []
 
 $additional_data = []
 
- 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

◆ __toString()

__toString ( )
See also
Range::__toString()

Implements Range.

◆ _set_semester()

_set_semester (   $field,
  $value 
)

◆ cbSetStartAndDurationTime()

cbSetStartAndDurationTime ( )

Called directly before storing the object to edit the columns start_time and duration_time which are both deprecated but are still in use for older plugins.

◆ configure()

static configure (   $config = [])
staticprotected

◆ countMembersWithStatus()

countMembersWithStatus (   $status)

Retrieves the number of all members of a status

Parameters
String | Array$statusthe status to filter with
Returns
int the number of all those members.

◆ describeRange()

describeRange ( )

Returns a descriptive text for the range type.

Returns
string

Implements Range.

◆ exportUserData()

static exportUserData ( StoredUserData  $storage)
static

Export available data of a given user into a storage object (an instance of the StoredUserData class) for that user.

Parameters
StoredUserData$storageobject to store data into

Implements PrivacyObject.

◆ findByUser()

static findByUser (   $user_id,
  $perms = [],
  $with_deputies = true 
)
static

Returns a list of courses for the specified user. Permission levels may be supplied to limit the course list.

Parameters
string$user_idThe ID of the user whose courses shall be retrieved.
string[]$perms The permission levels of the user that shall be regarded when retrieving courses.
bool$with_deputiesWhether to include courses where the user is a deputy (true) or not (false). Defaults to true.
Returns
Course[] A list of courses.

◆ findCurrent()

static findCurrent ( )
static

Returns the currently active course or false if none is active.

Returns
Course object of currently active course, null otherwise
Since
3.0

◆ getActivatedTools()

getActivatedTools ( )

returns all activated plugins/modules for this course

Returns
StudipModule[]

◆ getCalendarOwner()

static getCalendarOwner ( string  $owner_id)
static

Implements Owner.

◆ getCompetionLabel()

getCompetionLabel ( )

Returns the appropriate label for the completion status.

Returns
string

◆ getCompletionIcon()

getCompletionIcon ( )

Returns the appropriate icon for the completion status.

Mapping (completion -> icon role):

  • 0 => status-red
  • 1 => status-yellow
  • 2 => status-green
Returns
Icon class

◆ getConfiguration()

getConfiguration ( )

{Returns the configuration object for this range.

Returns
RangeConfig
}

Implements Range.

◆ getDatesWithExdates()

getDatesWithExdates (   $range_begin = 0,
  $range_end = 0 
)

Retrieves the course dates including cancelled dates ("ex-dates"). The dates can be filtered by an optional time range. By default, all dates are retrieved.

Parameters
int$range_beginThe begin timestamp of the time range.
int$range_endThe end timestamp of the time range.
Returns
SimpleCollection A collection of all retrieved dates and cancelled dates.

◆ getEnd_Time()

getEnd_Time ( )

◆ getEndSemester()

getEndSemester ( )

Retrieves the last semester of a course, if applicable.

Returns
Semester|null Either the last semester of the course or null, if no semester could be found.

◆ getFreeSeats()

getFreeSeats ( )

◆ getFullName()

getFullName (   $format = 'default')

Returns the full name of a course. If the important course numbers (IMPORTANT_SEMNUMBER) is set in global configs it will also display the coursenumber

Parameters
stringformatting template name
Returns
string Fullname

Implements Range.

◆ getItemAvatarURL()

getItemAvatarURL ( )

Returns the URL to the avatar image or icon of the object, if applicable.

Returns
string|null Either the URL to the object's avatar or icon or null, if the object does not have an avatar.

Implements StudipItem.

◆ getItemName()

getItemName (   $long_format = true)

Returns a human-readable name of the object.

Parameters
bool$long_formatIf set to true, a long format that has the object type as a prefix (course, room etc.) is returned. Otherwise only the name is returned.
Returns
string A human-readable string of the object's name.

Implements StudipItem.

◆ getItemURL()

getItemURL ( )

Returns an URL that points to a page describing or displaying the object.

Returns
string|null Either the URL to a descriptive page for the object or null, if the object does not have such an URL.

Implements StudipItem.

◆ getLink()

getLink ( )

Creates a StudipLink object that links to a page with information about the StudipItem object.

Returns
StudipLink A StudipLink object for the information page of the StudipItem object.

Implements StudipItem.

◆ getMembersData()

getMembersData ( ?string  $status = '')

Get user information for all users in this course

◆ getMembersWithStatus()

getMembersWithStatus (   $status,
  $as_collection = false 
)

Retrieves all members of a status

Parameters
String | Array$statusthe status to filter with
bool$as_collectionreturn collection instead of array?
Returns
Array|SimpleCollection an array of all those members.

◆ getMVVModulesForCourseId()

static getMVVModulesForCourseId ( string  $course_id,
?array  $statusses = null 
)
static

Returns the associated mvv modules for a given course id.

Parameters
string$course_id
array | null$statussesLimit the results by a given module status
Returns
Modul[]

◆ getNumParticipants()

getNumParticipants ( )

◆ getNumPrelimParticipants()

getNumPrelimParticipants ( )

◆ getNumWaiting()

getNumWaiting ( )

◆ getParticipantStatus()

getParticipantStatus (   $user_id)

◆ getRangeCourseId()

getRangeCourseId ( )

Returns the course id of FeedbackRange object instance

Returns
string course_id

Implements FeedbackRange.

◆ getRangeIcon()

getRangeIcon (   $role)

Returns the icon object that shall be used with the FeedbackRange object instance.

Parameters
string$rolerole of icon
Returns
Icon icon for the FeedbackRange object instance.

Implements FeedbackRange.

◆ getRangeId()

getRangeId ( )

Returns the id of the current range

Returns
string

Implements Range.

◆ getRangeName()

getRangeName ( )

Returns a human-friendly representation of the FeedbackRange object instance's name.

Returns
string A human-friendly name for the FeedbackRange object instance.

Implements FeedbackRange.

◆ getRangeType()

getRangeType ( )

Returns a unique identificator for the range type.

Returns
string

Implements Range.

◆ getRangeUrl()

getRangeUrl ( )

Returns the URL of FeedbackRange view, where the object instance is visible together with the related feedback element(s).

Returns
string Path that is usable with the url_for and link_for methods.

Implements FeedbackRange.

◆ getSemClass()

getSemClass ( )

Returns the SemClass object that is defined for the course

Returns
SemClass The SemClassObject for the course

◆ getSemType()

getSemType ( )

Returns the semType object that is defined for the course

Returns
SemType The semTypeObject for the course

◆ getStartSemester()

getStartSemester ( )

Retrieves the first semester of a course, if applicable.

Returns
Semester|null Either the first semester of the course or null, if no semester could be found.

◆ getTeachers()

getTeachers ( )

◆ getTextualSemester()

getTextualSemester ( )

Returns the readable semester duration as as string

Returns
string : readable semester

◆ isAccessibleToUser()

isAccessibleToUser (   $user_id = null)

Decides whether the user may access the range.

Parameters
string | null$user_idOptional id of a user, defaults to current user
Returns
bool

Implements Range.

◆ isCalendarReadable()

isCalendarReadable ( ?string  $user_id = null)

Implements Owner.

◆ isCalendarWritable()

isCalendarWritable ( string  $user_id = null)

◆ isEditableByUser()

isEditableByUser (   $user_id = null)

Decides whether the user may edit/alter the range.

Parameters
string | null$user_idOptional id of a user, defaults to current user
Returns
bool

Implements Range.

◆ isInSemester()

isInSemester ( Semester  $semester)

Returns if this course is in the given semester

Parameters
Semester$semester: instance of the given semester
Returns
bool : true if this course is part of this semester

◆ isOpenEnded()

isOpenEnded ( )

Returns true if this course has no end-semester. Else false.

Returns
bool : true if there is no end-semester

◆ isRangeAccessible()

isRangeAccessible ( string  $user_id = null)

Returns the accessebility of FeedbackRange object instance for current active user

Parameters
string$user_idoptional; use this ID instead of $GLOBALS['user']->id
Returns
bool range object accessebility

Implements FeedbackRange.

◆ isStudygroup()

isStudygroup ( )

Returns whether this course is a studygroup

Returns
bool

◆ isToolActive()

isToolActive (   $name)
Parameters
$namestring name of tool / plugin
Returns
bool

◆ isVisibleForUser()

isVisibleForUser (   $user_id = null)

Is the current course visible for the current user?

Parameters
string$user_id
Returns
bool Visible?

◆ isWaitlistAvailable()

isWaitlistAvailable ( )

◆ logStore()

logStore ( )
protected

Generates a general log entry if the course were changed. Furthermore, this method emits notifications when the start and/or the end semester has/have changed.

◆ setDefaultTools()

setDefaultTools ( )

◆ setEnd_Time()

setEnd_Time (   $value)

◆ setEndSemester()

setEndSemester ( ?Semester  $semester)
Parameters
Semester | null$semester

◆ setStartSemester()

setStartSemester ( Semester  $semester)
Parameters
Semester$semester

◆ setStudyAreas()

setStudyAreas (   $ids)

Sets this courses study areas to the given values.

Parameters
array$idsthe new study areas
Returns
bool Changes successfully saved?

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