|
| | initRelation ($relation) |
| |
| | _set_semester ($field, $value) |
| |
| | setStartSemester (Semester $semester) |
| |
| | setEndSemester (?Semester $semester) |
| |
| | getStartSemester () |
| |
| | getEndSemester () |
| |
| | getTextualSemester () |
| |
| | isOpenEnded () |
| |
| | isInSemester (Semester $semester) |
| |
| | getTeachers () |
| |
| | getFreeSeats () |
| |
| | isWaitlistAvailable () |
| |
| | hasCourseSet () |
| |
| | getCourseSet () |
| |
| | isAdmissionEnabled () |
| |
| | isAdmissionLocked () |
| |
| | isPasswordProtected () |
| |
| | getAdmissionTimeFrame () |
| |
| | addPreliminaryMember (User $user, string $comment='') |
| |
| | removePreliminaryMember (User $user) |
| |
| | addMemberToWaitlist (User $user, int $position=PHP_INT_MAX, bool $send_mail=true) |
| |
| | getCourseCategory () |
| |
| | getMembersWithStatus ($status, $as_collection=false) |
| |
| | countMembersWithStatus ($status) |
| |
| | addMember (User $user, string $permission_level='autor', bool $regard_contingent=true, bool $send_mail=true, bool $renumber_admission=true) |
| |
| | deleteMember (User $user, bool $send_mail=false) |
| |
| | moveMemberToWaitlist (User $user, bool $send_mail=false) |
| |
| | swapMemberPosition (CourseMember $membership, int $new_position) |
| |
| | moveMemberUp (User $user) |
| |
| | moveMemberDown (User $user) |
| |
| | getNumParticipants () |
| |
| | getNumPrelimParticipants () |
| |
| | getNumWaiting () |
| |
| | getParticipantStatus ($user_id) |
| |
| | getEnrolmentInformation (string $user_id) |
| |
| | getSemType () |
| |
| | getSemClass () |
| |
| | getFullName ($format='default') |
| |
| | getAllDatesInSemester (?Semester $start_semester=null, ?Semester $end_semester=null, bool $with_cancelled_dates=false) |
| |
| | getDatesWithExdates ($range_begin=0, $range_end=0) |
| |
| | getFirstDate () |
| |
| | getNextDate (bool $include_cancelled=false) |
| |
| | setStudyAreas ($ids) |
| |
| | isVisibleForUser ($user_id=null) |
| |
| | describeRange () |
| |
| | getRangeType () |
| |
| | getRangeId () |
| |
| | getConfiguration () |
| |
| | isAccessibleToUser ($user_id=null) |
| |
| | isEditableByUser ($user_id=null) |
| |
| | getCompletionIcon () |
| |
| | getCompetionLabel () |
| |
| | getItemName ($long_format=true) |
| |
| | getItemURL () |
| |
| | getItemAvatarURL () |
| |
| | getRangeName () |
| |
| | getRangeIcon ($role) |
| |
| | getRangeUrl () |
| |
| | getRangeCourseId () |
| |
| | isRangeAccessible (string $user_id=null) |
| |
| | getLink () |
| |
| | isStudygroup () |
| |
| | setDefaultTools () |
| |
| | isToolActive ($name) |
| |
| | getTool (string $name) |
| |
| | getActivatedTools () |
| |
| | __toString () |
| |
| | isCalendarReadable (?string $user_id=null) |
| |
| | isCalendarWritable (string $user_id=null) |
| |
| | getMembersData (?string $status='') |
| |
| | __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 () |
| |
| | getId () |
| |
| | isCalendarWritable (?string $user_id=null) |
| |
|
| 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 | 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) |
| |
| static | setMariadbDefaultColumnFix (bool $state=true) |
| |
◆ __toString()
◆ _set_semester()
| _set_semester |
( |
|
$field, |
|
|
|
$value |
|
) |
| |
◆ addMember()
| addMember |
( |
User |
$user, |
|
|
string |
$permission_level = 'autor', |
|
|
bool |
$regard_contingent = true, |
|
|
bool |
$send_mail = true, |
|
|
bool |
$renumber_admission = true |
|
) |
| |
Adds a user to this course.
- Parameters
-
| User | $user | The user to be added. |
| string | $permission_level | The permission level the user shall get in the course. |
| bool | $regard_contingent | Whether to regard the contingent of the course (true) or whether to ignore it (false). Defaults to true. |
| bool | $send_mail | Whether to send a mail to the new participant (true) or not (false). Defaults to true. |
| bool | $renumber_admission | Whether to call AdmissionApplication::renumberAdmission when the admission of the user has been removed (true) or whether not to renumber the admission entries (false). Defaults to true. Setting this parameter to false is useful when adding several users at once and then manually call AdmissionApplication::renumberAdmission so that the entries are renumbered only once after all the users have been added. |
- Returns
- CourseMember The CourseMember object for the user.
- Exceptions
-
◆ addMemberToWaitlist()
| addMemberToWaitlist |
( |
User |
$user, |
|
|
int |
$position = PHP_INT_MAX, |
|
|
bool |
$send_mail = true |
|
) |
| |
Adds a user to the waitlist of this course.
- Parameters
-
| User | $user | The user to be added onto the waitlist. |
| int | $position | The position of the user on the waitlist. |
| bool | $send_mail | Whether to send a mail to the user that has been added (true) or not (false). Defaults to true. |
- Returns
- AdmissionApplication The AdmissionApplication object for the added user.
- Exceptions
-
◆ addPreliminaryMember()
| addPreliminaryMember |
( |
User |
$user, |
|
|
string |
$comment = '' |
|
) |
| |
Adds a user as preliminary member to this course.
- Parameters
-
| User | $user | The user to be added as preliminary member. |
| string | $comment | An optional comment for the preliminary membership. |
- Returns
- AdmissionApplication The AdmissionApplication object for the preliminary membership.
- Exceptions
-
◆ cbAfterInitialize()
| cbAfterInitialize |
( |
|
$cb_type | ) |
|
|
protected |
◆ configure()
| static configure |
( |
|
$config = [] | ) |
|
|
staticprotected |
◆ countMembersWithStatus()
| countMembersWithStatus |
( |
|
$status | ) |
|
Retrieves the number of all members of a status
- Parameters
-
| String | Array | $status | the status to filter with |
- Returns
- int the number of all those members.
◆ deleteMember()
| deleteMember |
( |
User |
$user, |
|
|
bool |
$send_mail = false |
|
) |
| |
Removes a user from this course.
- Parameters
-
| User | $user | The user to be removed. |
| bool | $send_mail | Whether to send a mail after the membership deletion (true) or not (false). Defaults to false. |
- Returns
- void If this method does not throw, everything went fine.
- Exceptions
-
◆ describeRange()
Returns a descriptive text for the range type.
- Returns
- string
Implements Range.
◆ exportUserData()
Export available data of a given user into a storage object (an instance of the StoredUserData class) for that user.
- Parameters
-
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_id | The 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_deputies | Whether to include courses where the user is a deputy (true) or not (false). Defaults to true. |
- Returns
- Course[] A list of courses.
◆ findCurrent()
Returns the currently active course or false if none is active.
- Returns
- Course object of currently active course, null otherwise
- Since
- 3.0
◆ getActivatedTools()
returns all activated plugins/modules for this course
- Returns
- StudipModule[]
◆ getAdmissionTimeFrame()
| getAdmissionTimeFrame |
( |
| ) |
|
Determines if there is an admission time frame for this course by looking at the course set (if any). If such a time frame exists, it is returned as an associative array with the start and end timestamp.
- Returns
- array An associative array with the array keys "start_time" and "end_time" containing the start and end timestamp of the admission. In case no such time frame exists, an empty array is returned instead.
◆ getAllDatesInSemester()
| getAllDatesInSemester |
( |
?Semester |
$start_semester = null, |
|
|
?Semester |
$end_semester = null, |
|
|
bool |
$with_cancelled_dates = false |
|
) |
| |
Retrieves all dates (regular and irregular) that take place in a specified semester or a semester range.
- Parameters
-
| Semester | null | $start_semester | The semester for which to get all dates or the start semester of a semester range. |
| Semester | null | $end_semester | The end semester for a semester range. This can also be null in case only dates for one semester shall be retrieved. |
| bool | $with_cancelled_dates | Whether to include cancelled dates (true) or not (false). Defaults to false. |
- Returns
- CourseDateList A collection of irregular and regular course dates.
- Exceptions
-
◆ getCalendarOwner()
| static getCalendarOwner |
( |
string |
$owner_id | ) |
|
|
static |
◆ getCompetionLabel()
Returns the appropriate label for the completion status.
- Returns
- string
◆ 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()
{Returns the configuration object for this range.
- Returns
- RangeConfig
}
Implements Range.
◆ getCourseCategory()
Retrieves the course category for this course.
- Returns
- SeminarCategories The category object of the course.
◆ getCourseSet()
Retrieves the course set of th course, if the course is associated to a course set.
- Returns
- CourseSet|null The course set of the course, if it is associated to one.
◆ 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_begin | The begin timestamp of the time range. |
| int | $range_end | The end timestamp of the time range. |
- Returns
- SimpleCollection A collection of all retrieved dates and cancelled dates.
◆ 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.
◆ getEnrolmentInformation()
| getEnrolmentInformation |
( |
string |
$user_id | ) |
|
Determines the enrolment status of the user and their possibilities to join the course.
- Parameters
-
| string | $user_id | The ID of the user for which to get enrolment information. |
- Returns
- The enrolment information for the specified user.
◆ getFirstDate()
Retrieves the first date of the course that takes place.
- Returns
- CourseDate|null Either the first date as CourseDate or null in case the course has no dates.
◆ 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
-
| string | formatting template name |
- Returns
- string Fullname
Implements Range.
◆ 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_format | If 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()
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()
◆ 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 | $status | the status to filter with |
| bool | $as_collection | return collection instead of array? |
- Returns
- CourseMember[]|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 | $statusses | Limit the results by a given module status |
- Returns
- Modul[]
◆ getNextDate()
| getNextDate |
( |
bool |
$include_cancelled = false | ) |
|
Retrieves the next date for the course. If requested, the next cancelled date is retrieved if no date can be found that takes place.
The date must start in the future or within the past hour to be regarded as next date.
- Parameters
-
| bool | $include_cancelled | Include cancelled dates (true) or not. Defaults to false. |
- Returns
- CourseDate|CourseExDate|null A CourseDate or CourseExDate representing the next date or null in case there is no next date. CourseExDate instances are only returned if $include_cancelled is set to true.
◆ getNumParticipants()
◆ getNumPrelimParticipants()
| getNumPrelimParticipants |
( |
| ) |
|
◆ getNumWaiting()
◆ getParticipantStatus()
| getParticipantStatus |
( |
|
$user_id | ) |
|
◆ getRangeCourseId()
◆ getRangeIcon()
◆ getRangeId()
Returns the id of the current range
- Returns
- string
Implements Range.
◆ getRangeName()
◆ getRangeType()
Returns a unique identificator for the range type.
- Returns
- string
Implements Range.
◆ 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()
Returns the SemClass object that is defined for the course
- Returns
- SemClass The SemClassObject for the course
◆ getSemType()
Returns the semType object that is defined for the course
- Returns
- SemType The semTypeObject for the course
◆ 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()
◆ getTextualSemester()
Returns the readable semester duration as as string
- Returns
- string : readable semester
◆ getTool()
Returns the Plugin/Tool specified by its name in case it is activated in this course.
- Parameters
-
| string | $name | The name of the tool. |
- Returns
- StandardPlugin An instance for the tool.
- Exceptions
-
◆ handleInstitutes()
Handle all things related to storing the institutes
◆ hasCourseSet()
Determines whether the course has at least one course set attached to it.
- Returns
- bool True, if the course has at least one course set, false otherwise.
◆ initRelation()
| initRelation |
( |
|
$relation | ) |
|
◆ isAccessibleToUser()
| isAccessibleToUser |
( |
|
$user_id = null | ) |
|
Decides whether the user may access the range.
- Parameters
-
| string | null | $user_id | Optional id of a user, defaults to current user |
- Returns
- bool
Implements Range.
◆ isAdmissionEnabled()
Determines whether the number of participants in this course is limited by a course set whose seat distribution is enabled.
- Returns
- boolean True, if a course set exists and its seat distribution is enabled, false otherwise.
◆ isAdmissionLocked()
Determines by the course set of the course (if any), whether the admission is locked or not.
- Returns
- bool True, if the admission is locked, false otherwise.
◆ isCalendarReadable()
| isCalendarReadable |
( |
?string |
$user_id = null | ) |
|
◆ isCalendarWritable()
| isCalendarWritable |
( |
string |
$user_id = null | ) |
|
◆ isEditableByUser()
| isEditableByUser |
( |
|
$user_id = null | ) |
|
Decides whether the user may edit/alter the range.
- Parameters
-
| string | null | $user_id | Optional id of a user, defaults to current user |
- Returns
- bool
Implements Range.
◆ isInSemester()
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()
Returns true if this course has no end-semester. Else false.
- Returns
- bool : true if there is no end-semester
◆ isPasswordProtected()
Determines by looking at the course set (if any), whether the course is password protected or not.
- Returns
- bool True, fi the course is password protected, false otherwise.
◆ isRangeAccessible()
| isRangeAccessible |
( |
string |
$user_id = null | ) |
|
Returns the accessebility of FeedbackRange object instance for current active user
- Parameters
-
| string | $user_id | optional; use this ID instead of $GLOBALS['user']->id |
- Returns
- bool range object accessebility
Implements FeedbackRange.
◆ isStudygroup()
Returns whether this course is a studygroup
- Returns
- bool
◆ isToolActive()
- Parameters
-
| $name | string name of tool / plugin |
- Returns
- bool
◆ isVisibleForUser()
| isVisibleForUser |
( |
|
$user_id = null | ) |
|
Is the current course visible for the current user?
- Parameters
-
- Returns
- bool Visible?
◆ isWaitlistAvailable()
◆ logStore()
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.
◆ moveMemberDown()
| moveMemberDown |
( |
User |
$user | ) |
|
Moves a course member one position down.
- Parameters
-
| User | $user | The user to move down. |
- Returns
- int The new position of the user.
◆ moveMemberToWaitlist()
| moveMemberToWaitlist |
( |
User |
$user, |
|
|
bool |
$send_mail = false |
|
) |
| |
Moves a regular course member back onto the waitlist.
- Parameters
-
| User | $user | The course member to be moved back to the waitlist. |
| bool | $send_mail | Whether to send a mail to inform the user of them being moved back to the waitlist (true) or not (false). Defaults to false. |
- Returns
- void
- Exceptions
-
◆ moveMemberUp()
| moveMemberUp |
( |
User |
$user | ) |
|
Moves a course member one position up.
- Parameters
-
| User | $user | The user to move up. |
- Returns
- int The new position of the user.
◆ removePreliminaryMember()
| removePreliminaryMember |
( |
User |
$user | ) |
|
Removes a preliminary member from the course.
- Parameters
-
| User | $user | The member to be removed. |
- Exceptions
-
◆ setDefaultTools()
◆ setEndSemester()
◆ setStartSemester()
◆ setStudyAreas()
Sets this courses study areas to the given values.
- Parameters
-
| array | $ids | the new study areas |
- Returns
- bool Changes successfully saved?
◆ swapMemberPosition()
| swapMemberPosition |
( |
CourseMember |
$membership, |
|
|
int |
$new_position |
|
) |
| |
Swaps the course member position with another member. This is done by specifying a course member and the new position where they shall be placed in the course.
- Parameters
-
| CourseMember | $membership | The course member to move to another position. |
- Returns
- int The new position of the course member.
- Exceptions
-
◆ $currently_assigned_institutes
| $currently_assigned_institutes = null |
|
protected |
◆ $initial_end_semester
◆ $initial_start_semester
The documentation for this class was generated from the following file: