◆ __construct()
__construct |
( |
|
$setId = '' | ) |
|
◆ __clone()
◆ __toString()
◆ addAdmissionRule()
addAdmissionRule |
( |
|
$rule | ) |
|
Adds the given admission rule to the list of rules for the course set.
- Parameters
-
- Returns
- CourseSet
◆ addCourse()
Adds the course with the given ID to the course set.
- Parameters
-
- Returns
- CourseSet
◆ addCourseToSet()
static addCourseToSet |
( |
|
$set_id, |
|
|
|
$course_id |
|
) |
| |
|
static |
◆ addInstitute()
Adds a new institute ID.
- Parameters
-
- Returns
- CourseSet
◆ addInstitutes()
Adds several institute IDs to the existing institute assignments.
- Parameters
-
- Returns
- CourseSet
◆ addUserList()
Adds a UserList to the course set. The list contains several users and a factor that changes seat distribution chances for these users;
- Parameters
-
- Returns
- CourseSet
◆ checkAdmission()
checkAdmission |
( |
|
$userId, |
|
|
|
$courseId |
|
) |
| |
Is the given user allowed to register as participant in the given course according to the rules of this course set?
- Parameters
-
String | userId |
String | courseId |
- Returns
- Array Optional error messages from rules if something went wrong.
◆ clearAdmissionRules()
Removes all admission rules at once.
- Returns
- CourseSet
◆ delete()
Deletes the course set and all associated data.
◆ distributeSeats()
Starts the seat distribution algorithm.
◆ getAdmissionRule()
getAdmissionRule |
( |
|
$class_name | ) |
|
◆ getAdmissionRules()
Get all admission rules belonging to the course set.
- Returns
- AdmissionRule[]
◆ getAlgorithm()
◆ getAllowedUserCount()
How many users will be allowed to register according to the defined rules? This can help in estimating whether the combination of the defined rules makes sense.
- Returns
- int
◆ getChdate()
Returns the date of the last change.
- Returns
- int
◆ getCourses()
Gets the course IDs belonging to the course set.
- Returns
- Array
◆ getCoursesByCourseSetId()
static getCoursesByCourseSetId |
( |
|
$courseSetId | ) |
|
|
static |
Gets all courses belonging to the given course set ID.
- Parameters
-
- Returns
- Array
◆ getCoursesetsByInstituteId()
static getCoursesetsByInstituteId |
( |
|
$instituteId, |
|
|
|
$filter = [] |
|
) |
| |
|
static |
Gets all course sets belonging to the given institute ID.
- Parameters
-
- Returns
- Array
◆ getGlobalCoursesets()
static getGlobalCoursesets |
( |
|
$filter = [] | ) |
|
|
static |
Gets all global course sets
- Parameters
-
- Returns
- Array
◆ getGlobalLockedAdmissionSetId()
static getGlobalLockedAdmissionSetId |
( |
| ) |
|
|
static |
◆ getId()
Get the identifier of the course set.
- Returns
- String
◆ getInfoText()
Get the course set's info text.
- Returns
- String
◆ getInstituteIds()
Which institutes does the rule belong to?
- Returns
- Array
◆ getName()
Gets this course set's display name.
◆ getNumApplicants()
◆ getPriorities()
Retrieves the priorities given to the courses in this set.
- Returns
- Array
◆ getPrivate()
Is the current courseset private?
- Returns
- bool
◆ getSeatDistributionTime()
getSeatDistributionTime |
( |
| ) |
|
returns timestamp of distribution time or null if no distribution time available may return 0 if first-come-first-serve is enabled
- Returns
- integer|null timestamp of distribution
◆ getSemester()
returns latest semester id from assigned courses if no courses are assigned current semester
- Returns
- string id of semester
◆ getSetForCourse()
static getSetForCourse |
( |
|
$courseId | ) |
|
|
static |
Gets the course sets the given course belongs to.
- Parameters
-
- Returns
- CourseSet
◆ getSetForRule()
static getSetForRule |
( |
|
$rule_id | ) |
|
|
static |
Gets the course sets the given rule belongs to.
- Parameters
-
- Returns
- CourseSet
◆ getUserFactorList()
◆ getUserId()
Gets the owner of this course set.
◆ getUserLists()
Retrieves the lists of users that are considered specially in seat distribution.
- Returns
- Array
◆ hasAdmissionRule()
hasAdmissionRule |
( |
|
$rule | ) |
|
check if course set has given admission rule
- Parameters
-
- Returns
- boolean
◆ hasAlgorithmRun()
Evaluates whether the seat distribution algorithm has already been executed on this course set.
- Returns
- boolean True if algorithm has already run, otherwise false.
◆ isAdmissionRuleAllowed()
isAdmissionRuleAllowed |
( |
|
$admission_rule | ) |
|
checks if given rule is allowed to be added to current set of rules
- Parameters
-
- Returns
- boolean
◆ isGlobal()
◆ isSeatDistributionEnabled()
isSeatDistributionEnabled |
( |
| ) |
|
returns true if the set allows only a limited number of places
- Returns
- boolean
◆ isUserAllowedToAssignCourse()
isUserAllowedToAssignCourse |
( |
|
$user_id, |
|
|
|
$course_id |
|
) |
| |
is user with given user id allowed to assign/unassign given course to courseset
- Parameters
-
string | $user_id | |
string | $course_id | |
- Returns
- boolean
◆ isUserAllowedToEdit()
isUserAllowedToEdit |
( |
|
$user_id | ) |
|
is user with given user id allowed to edit or delete the courseset
- Parameters
-
- Returns
- boolean
◆ load()
Helper function for loading data from DB.
◆ removeAdmissionRule()
removeAdmissionRule |
( |
|
$ruleId | ) |
|
Removes the rule with the given ID from the set.
- Parameters
-
- Returns
- CourseSet
◆ removeCourse()
removeCourse |
( |
|
$courseId | ) |
|
Removes the course with the given ID from the set.
- Parameters
-
- Returns
- CourseSet
◆ removeCourseFromSet()
static removeCourseFromSet |
( |
|
$set_id, |
|
|
|
$course_id |
|
) |
| |
|
static |
◆ removeInstitute()
removeInstitute |
( |
|
$instituteId | ) |
|
Removes the institute with the given ID from the set.
- Parameters
-
- Returns
- CourseSet
◆ removeUserlist()
removeUserlist |
( |
|
$listId | ) |
|
Removes the user list with the given ID from the set.
- Parameters
-
- Returns
- CourseSet
◆ setAdmissionRules()
setAdmissionRules |
( |
|
$newRules | ) |
|
Adds several admission rules after clearing the existing rule assignments.
- Parameters
-
- Returns
- CourseSet
◆ setAlgorithm()
setAlgorithm |
( |
|
$newAlgorithm | ) |
|
Sets a seat distribution algorithm for this course set. This will only have an effect in conjunction with a TimedAdmission, as the algorithm needs a defined point in time where it will start.
- Parameters
-
- Returns
- CourseSet
◆ setAlgorithmRun()
setAlgorithmRun |
( |
|
$state | ) |
|
◆ setCourses()
Adds several course IDs after clearing the existing course assignments.
- Parameters
-
- Returns
- CourseSet
◆ setInfoText()
Set the course set's info text.
- Returns
- CourseSet
◆ setInstitutes()
Adds several institute IDs after clearing the existing institute assignments.
- Parameters
-
- Returns
- CourseSet
◆ setName()
◆ setPrivate()
setPrivate |
( |
|
$newPrivate | ) |
|
Set a new value for courseset privacy.
- Parameters
-
- Returns
- CourseSet
◆ setUserId()
◆ setUserlists()
Adds several user list IDs after clearing the existing user list assignments.
- Parameters
-
- Returns
- CourseSet
◆ store()
◆ toString()
toString |
( |
|
$short = false | ) |
|
A textual description of the current rule.
- Parameters
-
bool | short Show only short info without overview of assigned courses and institutes. |
- Returns
- String
◆ $admissionRules
Admission rules that are applied to the courses belonging to this set.
◆ $algorithm
Seat distribution algorithm.
◆ $chdate
When was the course set changed?
◆ $courses
IDs of courses that are aggregated into this set. The array is in the form ($courseId1 => true, $courseId2 => true).
◆ $hasAlgorithmRun
Has the seat distribution algorithm already been executed?
◆ $id
Unique identifier for this set.
◆ $infoText
Some extensive descriptional text for informing confused students.
◆ $institutes
Which Stud.IP institute does the course set belong to?
◆ $name
Some display name for this course set.
◆ $private
Is the course set only visible for the creator?
◆ $user_id
Who owns this course set?
◆ $userlists
The documentation for this class was generated from the following file: