Stud.IP
6.0
|
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 | |
cbAfterInitialize ($cb_type) | |
handleInstitutes () | |
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) |
Protected Attributes | |
$initial_start_semester | |
$initial_end_semester | |
$currently_assigned_institutes = null | |
Protected Attributes inherited from SimpleORMap | |
$content = [] | |
$content_db = [] | |
$is_new = true | |
$is_deleted = false | |
$relations = [] | |
$additional_data = [] | |
string | $i18n_class = I18NString::class |
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 |
__toString | ( | ) |
Implements Range.
_set_semester | ( | $field, | |
$value | |||
) |
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.
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. |
Adds a user to the waitlist of this course.
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. |
addPreliminaryMember | ( | User | $user, |
string | $comment = '' |
||
) |
Adds a user as preliminary member to this course.
User | $user | The user to be added as preliminary member. |
string | $comment | An optional comment for the preliminary membership. |
|
protected |
Override of SimpleORMap::cbAfterInitialize for resetting the flags that indicate semester changes.
|
staticprotected |
countMembersWithStatus | ( | $status | ) |
Retrieves the number of all members of a status
String | Array | $status | the status to filter with |
Removes a user from this course.
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. |
describeRange | ( | ) |
|
static |
Export available data of a given user into a storage object (an instance of the StoredUserData class) for that user.
StoredUserData | $storage | object to store data into |
Implements PrivacyObject.
|
static |
Returns a list of courses for the specified user. Permission levels may be supplied to limit the course list.
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. |
|
static |
Returns the currently active course or false if none is active.
getActivatedTools | ( | ) |
returns all activated plugins/modules for this course
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.
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.
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. |
|
static |
Implements Owner.
getCompetionLabel | ( | ) |
Returns the appropriate label for the completion status.
getCompletionIcon | ( | ) |
Returns the appropriate icon for the completion status.
Mapping (completion -> icon role):
getConfiguration | ( | ) |
getCourseCategory | ( | ) |
Retrieves the course category for this course.
getCourseSet | ( | ) |
Retrieves the course set of th course, if the course is associated to a course set.
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.
int | $range_begin | The begin timestamp of the time range. |
int | $range_end | The end timestamp of the time range. |
getEndSemester | ( | ) |
Retrieves the last semester of a course, if applicable.
getEnrolmentInformation | ( | string | $user_id | ) |
Determines the enrolment status of the user and their possibilities to join the course.
string | $user_id | The ID of the user for which to get enrolment information. |
getFirstDate | ( | ) |
Retrieves the first date of the course that takes place.
getFreeSeats | ( | ) |
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
string | formatting template name |
Implements Range.
getItemAvatarURL | ( | ) |
Returns the URL to the avatar image or icon of the object, if applicable.
Implements StudipItem.
getItemName | ( | $long_format = true | ) |
Returns a human-readable name of the object.
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. |
Implements StudipItem.
getItemURL | ( | ) |
Returns an URL that points to a page describing or displaying the object.
Implements StudipItem.
getLink | ( | ) |
Creates a StudipLink object that links to a page with information about the StudipItem object.
Implements StudipItem.
getMembersData | ( | ?string | $status = '' | ) |
Get user information for all users in this course
getMembersWithStatus | ( | $status, | |
$as_collection = false |
|||
) |
Retrieves all members of a status
String | Array | $status | the status to filter with |
bool | $as_collection | return collection instead of array? |
|
static |
Returns the associated mvv modules for a given course id.
string | $course_id | |
array | null | $statusses | Limit the results by a given module status |
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.
bool | $include_cancelled | Include cancelled dates (true) or not. Defaults to false. |
getNumParticipants | ( | ) |
getNumPrelimParticipants | ( | ) |
getNumWaiting | ( | ) |
getParticipantStatus | ( | $user_id | ) |
getRangeCourseId | ( | ) |
Returns the course id of FeedbackRange object instance
Implements FeedbackRange.
getRangeIcon | ( | $role | ) |
Returns the icon object that shall be used with the FeedbackRange object instance.
string | $role | role of icon |
Implements FeedbackRange.
getRangeId | ( | ) |
getRangeName | ( | ) |
Returns a human-friendly representation of the FeedbackRange object instance's name.
Implements FeedbackRange.
getRangeType | ( | ) |
getRangeUrl | ( | ) |
Returns the URL of FeedbackRange view, where the object instance is visible together with the related feedback element(s).
Implements FeedbackRange.
getSemClass | ( | ) |
getSemType | ( | ) |
Returns the semType object that is defined for the course
getStartSemester | ( | ) |
Retrieves the first semester of a course, if applicable.
getTeachers | ( | ) |
getTextualSemester | ( | ) |
Returns the readable semester duration as as string
getTool | ( | string | $name | ) |
Returns the Plugin/Tool specified by its name in case it is activated in this course.
string | $name | The name of the tool. |
|
protected |
Handle all things related to storing the institutes
hasCourseSet | ( | ) |
Determines whether the course has at least one course set attached to it.
initRelation | ( | $relation | ) |
string | $relation |
isAccessibleToUser | ( | $user_id = null | ) |
Decides whether the user may access the range.
string | null | $user_id | Optional id of a user, defaults to current user |
Implements Range.
isAdmissionEnabled | ( | ) |
Determines whether the number of participants in this course is limited by a course set whose seat distribution is enabled.
isAdmissionLocked | ( | ) |
Determines by the course set of the course (if any), whether the admission is locked or not.
isCalendarReadable | ( | ?string | $user_id = null | ) |
Implements Owner.
isCalendarWritable | ( | string | $user_id = null | ) |
isEditableByUser | ( | $user_id = null | ) |
Decides whether the user may edit/alter the range.
string | null | $user_id | Optional id of a user, defaults to current user |
Implements Range.
isInSemester | ( | Semester | $semester | ) |
Returns if this course is in the given semester
Semester | $semester | : instance of the given semester |
isOpenEnded | ( | ) |
Returns true if this course has no end-semester. Else false.
isPasswordProtected | ( | ) |
Determines by looking at the course set (if any), whether the course is password protected or not.
isRangeAccessible | ( | string | $user_id = null | ) |
Returns the accessebility of FeedbackRange object instance for current active user
string | $user_id | optional; use this ID instead of $GLOBALS['user']->id |
Implements FeedbackRange.
isStudygroup | ( | ) |
Returns whether this course is a studygroup
isToolActive | ( | $name | ) |
$name | string name of tool / plugin |
isVisibleForUser | ( | $user_id = null | ) |
Is the current course visible for the current user?
string | $user_id |
isWaitlistAvailable | ( | ) |
|
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.
moveMemberDown | ( | User | $user | ) |
Moves a course member one position down.
User | $user | The user to move down. |
Moves a regular course member back onto the waitlist.
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. |
moveMemberUp | ( | User | $user | ) |
Moves a course member one position up.
User | $user | The user to move up. |
removePreliminaryMember | ( | User | $user | ) |
Removes a preliminary member from the course.
User | $user | The member to be removed. |
setDefaultTools | ( | ) |
setStudyAreas | ( | $ids | ) |
Sets this courses study areas to the given values.
array | $ids | the new study areas |
setValue | ( | $field, | |
$value | |||
) |
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.
CourseMember | $membership | The course member to move to another position. |
|
protected |
|
protected |
|
protected |