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

Public Member Functions

 __construct ($ruleId='', $courseSetId= '')
 
 delete ()
 
 getCustomMaxNumber ($userId)
 
 getMaxNumber ()
 
 getMaxNumberForUser ($userId)
 
 getTemplate ()
 
 load ()
 
 ruleApplies ($userId, $courseId)
 
 setAllData ($data)
 
 setCustomMaxNumber ($userId, $maxNumber)
 
 setMaxNumber ($newMaxNumber)
 
 store ()
 
 toString ()
 
 validate ($data)
 
 getMessage ($max_number=null)
 
- 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

 $maxNumber = 1
 
- Data Fields inherited from AdmissionRule
 $endTime = 0
 
 $id = ''
 
 $message = ''
 
 $default_message = ''
 
 $startTime = 0
 
 $courseSetId = ''
 
 $siblings = []
 
 $siblings_override = false
 

Constructor & Destructor Documentation

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

Standard constructor.

Parameters
StringruleId
Returns
LimitedAdmission

Member Function Documentation

delete ( )

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
userId
Returns
Integer
static getDescription ( )
static

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

getMaxNumber ( )

Gets the maximal number of courses that users can be registered for.

Returns
Integer
getMaxNumberForUser (   $userId)
getMessage (   $max_number = null)
static getName ( )
static

Return this rule's name.

getTemplate ( )

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

Returns
String
load ( )

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
StringuserId
StringcourseId
Returns
Array Any errors that occurred on admission.
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.
setCustomMaxNumber (   $userId,
  $maxNumber 
)

Sets a new maximal number of courses that the given user can register for.

Parameters
StringuserId
IntegermaxNumber
Returns
LimitedAdmission
setMaxNumber (   $newMaxNumber)

Sets a new maximal number of courses for registration of the same user.

Parameters
IntegernewMaxNumber
Returns
LimitedAdmission
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

$maxNumber = 1

Maximal number of courses that a user can register for.


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