Stud.IP  5.4
ConditionalAdmission Class Reference
Inheritance diagram for ConditionalAdmission:
AdmissionRule

Public Member Functions

 __construct ($ruleId='', $courseSetId='')
 
 addCondition ($condition, $group='', $quota=0)
 
 delete ()
 
 getAffectedUsers ()
 
 getConditions ()
 
 getConditionGroups ()
 
 getUngroupedConditions ()
 
 getQuota ($group_id)
 
 getTemplate ()
 
 load ()
 
 conditiongroupsAllowed ()
 
 removeConditionGroups ()
 
 removeCondition ($conditionId)
 
 ruleApplies ($userId, $courseId)
 
 setAllData ($data)
 
 store ()
 
 toString ()
 
 validate ($data)
 
 getMessage ($condition=null)
 
 __clone ()
 
 setSiblings ($siblings=[])
 
- 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

 $conditions = []
 
 $conditiongroups = []
 
 $ungrouped_conditions = []
 
 $quota = []
 
 $conditiongroups_allowed = null
 
 $siblings = []
 
- Data Fields inherited from AdmissionRule
 $endTime = 0
 
 $id = ''
 
 $message = ''
 
 $default_message = ''
 
 $startTime = 0
 
 $courseSetId = ''
 
 $siblings = []
 
 $siblings_override = false
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $ruleId = '',
  $courseSetId = '' 
)

Standard constructor.

Parameters
String$ruleIdIf this rule has been saved previously, it will be loaded from database.
Returns
ConditionalAdmission the current object (this).

Member Function Documentation

◆ __clone()

__clone ( )

◆ addCondition()

addCondition (   $condition,
  $group = '',
  $quota = 0 
)

Adds a new UserFilter to this rule.

Parameters
UserFilter$condition
String$group
Int$quota
Returns
ConditionalAdmission

◆ conditiongroupsAllowed()

conditiongroupsAllowed ( )

Checks if condition groups are allowed.

Returns
Boolean

◆ delete()

delete ( )

Deletes the admission rule and all associated data.

◆ getAffectedUsers()

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.

◆ getConditionGroups()

getConditionGroups ( )

Gets all grouped conditiongroups.

Returns
Array

◆ getConditions()

getConditions ( )

Gets all defined conditions.

Returns
Array

◆ getDescription()

static getDescription ( )
static

Gets some text that describes what this AdmissionRule (or respective subclass) does.

◆ getMessage()

getMessage (   $condition = null)

◆ getName()

static getName ( )
static

Return this rule's name.

◆ getQuota()

getQuota (   $group_id)

Gets quota for given conditiongroup.

Returns
Array

◆ getTemplate()

getTemplate ( )

Gets the template that provides a configuration GUI for this rule.

Returns
String

◆ getUngroupedConditions()

getUngroupedConditions ( )

Gets all grouped conditiongroups.

Returns
Array

◆ load()

load ( )

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

◆ removeCondition()

removeCondition (   $conditionId)

Removes the condition with the given ID from the rule.

Parameters
String$conditionId
Returns
ConditionalAdmission

◆ removeConditionGroups()

removeConditionGroups ( )

Removes condition groups and sets all conditions as ungrouped.

◆ ruleApplies()

ruleApplies (   $userId,
  $courseId 
)

Checks whether the given user fulfills the configured admission conditions. Only one of the conditions needs to be fulfilled (logical operator OR). The fields in a condition are in conjunction (logical operator AND).

Parameters
String$userId
String$courseId
Returns
Array Array with conditions that have failed. If array is empty, everything's all right.

◆ setAllData()

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.

◆ setSiblings()

setSiblings (   $siblings = [])

◆ store()

store ( )

Helper function for storing data to DB.

◆ toString()

toString ( )

A textual description of the current rule.

Returns
String

◆ validate()

validate (   $data)

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

Parameters
Array$dataRequest data
Returns
Array Error messages.

Field Documentation

◆ $conditiongroups

$conditiongroups = []

Grouped conditions that must be fulfilled for successful admission.

◆ $conditiongroups_allowed

$conditiongroups_allowed = null

Are condition groups allowed?

◆ $conditions

$conditions = []

All conditions that must be fulfilled for successful admission.

◆ $quota

$quota = []

Quota for grouped conditions

◆ $siblings

$siblings = []

courseset siblings of this rule

◆ $ungrouped_conditions

$ungrouped_conditions = []

Conditions that must be fulfilled for successful admission.


The documentation for this class was generated from the following file: