Stud.IP  4.2 Revision
AdmissionRule Class Reference
Inheritance diagram for AdmissionRule:
Inheritance graph
Collaboration diagram for AdmissionRule:
Collaboration graph

Public Member Functions

 __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=array())
 
 isCombinationAllowed ($admission_rule)
 
 __clone ()
 

Static Public Member Functions

static getAvailableAdmissionRules ($activeOnly=true)
 
static getInputFrame ()
 
static getDescription ()
 
static getName ()
 

Data Fields

 $endTime = 0
 
 $id = ''
 
 $message = ''
 
 $default_message = ''
 
 $startTime = 0
 
 $courseSetId = ''
 
 $siblings = array()
 
 $siblings_override = false
 

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ __clone()

__clone ( )

◆ __toString()

__toString ( )

Standard string representation of this object.

Returns
String
Here is the call graph for this function:

◆ afterSeatDistribution()

afterSeatDistribution (   $courseset)

Hook that can be called after the seat distribution on the courseset has completed.

Parameters
CourseSet$coursesetCurrent courseset.

◆ beforeSeatDistribution()

beforeSeatDistribution (   $courseset)

Hook that can be called when the seat distribution on the courseset starts.

Parameters
CourseSetThe courseset this rule belongs to.

◆ checkTimeFrame()

checkTimeFrame ( )

Checks if we are in the rule validity time frame.

Returns
True if the rule is valid because the time frame applies, otherwise false.
Here is the caller graph for this function:

◆ delete()

delete ( )

Deletes the admission rule and all associated data.

Here is the call graph for this function:

◆ generateId()

generateId (   $tableName)

Generate a new unique ID.

Parameters
StringtableName
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

◆ getAvailableAdmissionRules()

static getAvailableAdmissionRules (   $activeOnly = true)
static

Reads all available AdmissionRule subclasses and loads their definitions.

Parameters
bool$activeOnlyShow only active rules.
Returns
Array
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDescription()

static getDescription ( )
static

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

◆ getEndTime()

getEndTime ( )

Get end of validity.

Returns
Integer

◆ getId()

getId ( )

Gets the rule ID.

Returns
String This rule's ID.

◆ getInput()

getInput ( )

◆ getInputFrame()

static getInputFrame ( )
staticfinal

Subclasses of AdmissionRule can require additional data to be entered on admission (like PasswordAdmission which needs a password for course access). Their corresponding method getInput only returns a HTML form fragment as the output can be concatenated with output from other rules. This static method provides the frame for rendering a full HTML form around the fragments from subclasses.

Returns
Array Start and end templates which wrap input form fragments from subclasses.
Here is the call graph for this function:

◆ getMessage()

getMessage ( )

Gets the message that is shown to users rejected by this rule.

Returns
String The message.
Here is the caller graph for this function:

◆ getName()

static getName ( )
static

Return this rule's name.

◆ getSiblings()

getSiblings ( )

get sibling rules

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getStartTime()

getStartTime ( )

Gets start of validity.

Returns
Integer

◆ getTemplate()

getTemplate ( )

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

Returns
String

◆ isCombinationAllowed()

isCombinationAllowed (   $admission_rule)

checks if given admission rule is allowed to be combined with this rule

Parameters
AdmissionRule | string$admission_rule
Returns
boolean
Here is the call graph for this function:

◆ load()

load ( )

Internal helper function for loading rule definition from database.

◆ loadSiblings()

loadSiblings ( )

load sibling rules

Here is the caller graph for this function:

◆ ruleApplies()

ruleApplies (   $userId,
  $courseId 
)

Does the current rule allow the given user to register as participant in the given course?

Parameters
StringuserId
StringcourseId
Returns
Array

◆ 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.

◆ setEndTime()

setEndTime (   $newEndTime)

Sets a new end time for condition validity.

Parameters
IntegernewEndTime
Returns
UserFilter

◆ setMessage()

setMessage (   $newMessage)

Sets a new message to show to users.

Parameters
StringnewMessage A new message text.
Returns
AdmissionRule This object

◆ setSiblings()

setSiblings (   $siblings = array())

set sibling rules

◆ setStartTime()

setStartTime (   $newStartTime)

Sets a new start time for condition validity.

Parameters
IntegernewStartTime
Returns
UserFilter

◆ store()

store ( )

Helper function for storing rule definition to database.

◆ toString()

toString ( )

A textual description of the current rule.

Returns
String
Here is the caller graph for this function:

◆ validate()

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

◆ $courseSetId

$courseSetId = ''

ID of the CourseSet this admission rule belongs to (is stored here for performance reasons).

◆ $default_message

$default_message = ''

default message that is shown to users that are rejected for admission because of the current rule.

◆ $endTime

$endTime = 0

When does the validity end?

◆ $id

$id = ''

A unique identifier for this rule.

◆ $message

$message = ''

A customizable message that is shown to users that are rejected for admission because of the current rule.

◆ $siblings

$siblings = array()

courseset siblings of this rule

◆ $siblings_override

$siblings_override = false

Are siblings set manually?

◆ $startTime

$startTime = 0

When does the validity start?


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