__construct |
( |
|
$ruleId = '' , |
|
|
|
$courseSetId = '' |
|
) |
| |
Deletes the admission rule and all associated data.
getCustomMaxNumber |
( |
|
$userId | ) |
|
Users can specify their own maximal number of courses they want to be registered for. This method gets the specified value for the given user or the max number that has been specified by the rule if no custom number was set.
- Parameters
-
- Returns
- Integer
static getDescription |
( |
| ) |
|
|
static |
Gets some text that describes what this AdmissionRule (or respective subclass) does.
Gets the maximal number of courses that users can be registered for.
- Returns
- Integer
getMaxNumberForUser |
( |
|
$userId | ) |
|
getMessage |
( |
|
$max_number = null | ) |
|
Gets the template that provides a configuration GUI for this rule.
- Returns
- String
Internal helper function for loading rule definition from database.
ruleApplies |
( |
|
$userId, |
|
|
|
$courseId |
|
) |
| |
Does the current rule allow the given user to register as participant in the given course? That only happens when the user has no more than the given number of registrations at the other courses in the course set.
- Parameters
-
String | userId |
String | courseId |
- Returns
- Array Any errors that occurred on admission.
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.
setCustomMaxNumber |
( |
|
$userId, |
|
|
|
$maxNumber |
|
) |
| |
Sets a new maximal number of courses that the given user can register for.
- Parameters
-
String | userId |
Integer | maxNumber |
- Returns
- LimitedAdmission
setMaxNumber |
( |
|
$newMaxNumber | ) |
|
Sets a new maximal number of courses for registration of the same user.
- Parameters
-
- Returns
- LimitedAdmission
Helper function for storing data to DB.
A textual description of the current rule.
- Returns
- String
Validates if the given request data is sufficient to configure this rule (e.g. if required values are present).
- Parameters
-
- Returns
- Array Error messages.
Maximal number of courses that a user can register for.
The documentation for this class was generated from the following file: