Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
PreferentialAdmission Class Reference
Inheritance diagram for PreferentialAdmission:
AdmissionRule

Public Member Functions

 __construct ($ruleId='')
 
 addCondition ($condition)
 
 afterSeatDistribution ($courseset)
 
 beforeSeatDistribution ($courseset)
 
 delete ()
 
 getAffectedUsers ()
 
 getConditions ()
 
 getFavorSemester ()
 
 getSemesterGroups ($users, $considerConditions, $exclude=[])
 
 getTemplate ()
 
 load ()
 
 removeCondition ($conditionId)
 
 ruleApplies ($userId, $courseId)
 
 setAllData ($data)
 
 setFavorSemester ($newFavorSemester)
 
 setSemesterBonus ($courseset, $grouped, $baseBonus=1)
 
 store ()
 
 toString ()
 
 validate ($data)
 
 __clone ()
 
- Public Member Functions inherited from AdmissionRule
 __construct ($ruleId= '', $courseSetId= '')
 
 afterSeatDistribution ($courseset)
 
 checkTimeFrame ()
 
 delete ()
 
 generateId ($tableName)
 
 getAffectedUsers ()
 
 getEndTime ()
 
 getInput ()
 
 getId ()
 
 getMessage ()
 
 getStartTime ()
 
 getTemplate ()
 
 load ()
 
 beforeSeatDistribution ($courseset)
 
 ruleApplies ($userId, $courseId)
 
 setAllData ($data)
 
 setEndTime ($newEndTime)
 
 setMessage ($newMessage)
 
 setStartTime ($newStartTime)
 
 store ()
 
 toString ()
 
 validate ($data)
 
 __toString ()
 
 loadSiblings ()
 
 getSiblings ()
 
 setSiblings ($siblings=[])
 
 isCombinationAllowed ($admission_rule)
 
 __clone ()
 

Static Public Member Functions

static getDescription ()
 
static getName ()
 
- Static Public Member Functions inherited from AdmissionRule
static getAvailableAdmissionRules ($activeOnly=true)
 
static getInputFrame ()
 
static getDescription ()
 
static getName ()
 

Data Fields

 $userlists = []
 
 $conditions = []
 
 $favorSemester = false
 
 $bonus_difference = 100
 
 $courseset = null
 
- Data Fields inherited from AdmissionRule
 $endTime = 0
 
 $id = ''
 
 $message = ''
 
 $default_message = ''
 
 $startTime = 0
 
 $courseSetId = ''
 
 $siblings = []
 
 $siblings_override = false
 

Constructor & Destructor Documentation

__construct (   $ruleId = '')

Standard constructor.

Parameters
StringruleId If this rule has been saved previously, it will be loaded from database.
Returns
AdmissionRule the current object (this).

Member Function Documentation

__clone ( )
addCondition (   $condition)

Adds a new UserFilter to this rule.

Parameters
UserFiltercondition
Returns
PreferentialAdmission
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 (   $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
CourseSetThe courseset this rule belongs to.
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
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
static getName ( )
static

Return this rule's name.

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
$usersuser IDs to process
$considerConditionsshould only the semesters of study belonging to given conditions be considered?
array$excludeuser 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 ( )

Helper function for loading data from DB. Generic AdmissionRule data is loaded with the parent load() method.

removeCondition (   $conditionId)

Removes the condition with the given ID from the rule.

Parameters
StringconditionId
Returns
PreferentialAdmission
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 (   $data)

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
Array$data
Returns
AdmissionRule This object.
setFavorSemester (   $newFavorSemester)

New setting for favoring higher semesters of study.

Parameters
bool$newFavorSemester
Returns
PreferentialAdmission
setSemesterBonus (   $courseset,
  $grouped,
  $baseBonus = 1 
)

Create user lists and set bonus corresponding to the maximal available semester of study for given users.

Parameters
$coursesetCourseSet to add user lists to
$groupedassociative array of users in the form <semester> => array(<user_id1>, <user_id2, ...))
$baseBonusbasic 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 (   $data)

Validates if the given request data is sufficient to configure this rule (e.g. if required values are present).

Parameters
ArrayRequest data
Returns
Array Error messages.

Field Documentation

$bonus_difference = 100

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 = null

The courseset this rule belongs to.

$favorSemester = false

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: