◆ __construct()
__construct |
( |
|
$ruleId = '' | ) |
|
Standard constructor.
- Parameters
-
String | ruleId If this rule has been saved previously, it will be loaded from database. |
- Returns
- AdmissionRule the current object (this).
◆ __clone()
◆ addCondition()
addCondition |
( |
|
$condition | ) |
|
◆ afterSeatDistribution()
afterSeatDistribution |
( |
|
$courseset | ) |
|
Hook that can be called after the seat distribution on the courseset has completed. User lists that were generated before are removed now.
◆ beforeSeatDistribution()
beforeSeatDistribution |
( |
|
$courseset | ) |
|
Hook that can be called when the seat distribution on the courseset starts. This type of admission rule gets all users that fulfill the specified conditions and generates user lists with modified chances in seat distribution.
- Parameters
-
◆ delete()
Deletes the admission rule and all associated data.
◆ getAffectedUsers()
Gets all users that are matched by thÃs rule.
- Returns
- Array An array containing IDs of users who are matched by this rule.
◆ getConditions()
Gets all defined conditions.
- Returns
- Array
◆ getDescription()
static getDescription |
( |
| ) |
|
|
static |
Gets some text that describes what this AdmissionRule (or respective subclass) does.
◆ getFavorSemester()
Returns whether higher semesters of study should be favored.
- Returns
- bool
◆ getName()
◆ getSemesterGroups()
getSemesterGroups |
( |
|
$users, |
|
|
|
$considerConditions, |
|
|
|
$exclude = [] |
|
) |
| |
Gets the semesters of study for the given users. If conditions are set and should be considered, only the semesters of study belonging to the given conditions are set.
- Parameters
-
| $users | user IDs to process |
| $considerConditions | should only the semesters of study belonging to given conditions be considered? |
array | $exclude | user IDs to exclude |
- Returns
- array Users with their maximal semester of study.
◆ getTemplate()
Gets the template that provides a configuration GUI for this rule.
- Returns
- String
◆ load()
◆ removeCondition()
removeCondition |
( |
|
$conditionId | ) |
|
◆ ruleApplies()
ruleApplies |
( |
|
$userId, |
|
|
|
$courseId |
|
) |
| |
Admission is open for everyone. On seat distribution, the rule conditions will be used to generate user lists with the specified chance.
- Parameters
-
String | $userId | |
String | $courseId | |
- Returns
- Array Is the user allowed to register or are there any errors?
◆ setAllData()
Uses the given data to fill the object values. This can be used as a generic function for storing data if the concrete rule type isn't known in advance.
- Parameters
-
- Returns
- AdmissionRule This object.
◆ setFavorSemester()
setFavorSemester |
( |
|
$newFavorSemester | ) |
|
◆ setSemesterBonus()
setSemesterBonus |
( |
|
$courseset, |
|
|
|
$grouped, |
|
|
|
$baseBonus = 1 |
|
) |
| |
Create user lists and set bonus corresponding to the maximal available semester of study for given users.
- Parameters
-
$courseset | CourseSet to add user lists to |
$grouped | associative array of users in the form <semester> => array(<user_id1>, <user_id2, ...)) |
$baseBonus | basic bonus to start with, defaults to 0. |
◆ store()
Helper function for storing data to DB.
◆ toString()
A textual description of the current rule.
- Returns
- String
◆ validate()
Validates if the given request data is sufficient to configure this rule (e.g. if required values are present).
- Parameters
-
- Returns
- Array Error messages.
◆ $bonus_difference
If semesters are favored, which bonus difference shall be set between each semester of study?
◆ $conditions
Conditions for selecting the favored people in seat distribution.
◆ $courseset
The courseset this rule belongs to.
◆ $favorSemester
Should higher semesters of study be favored?
◆ $userlists
Stores IDs of userlists generated for representing the selected conditions. These lists are created on seat distribution in the course set and are deleted immediately after.
The documentation for this class was generated from the following file: