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

Public Member Functions

 __construct ($setId='')
 
 addAdmissionRule ($rule)
 
 addCourse ($courseId)
 
 addInstitute ($newId)
 
 addInstitutes ($newIds)
 
 addUserList ($listId)
 
 checkAdmission ($userId, $courseId)
 
 clearAdmissionRules ()
 
 delete ()
 
 distributeSeats ()
 
 setAlgorithmRun ($state)
 
 isSeatDistributionEnabled ()
 
 getSeatDistributionTime ()
 
 getAdmissionRules ()
 
 getAdmissionRule ($class_name)
 
 hasAdmissionRule ($rule)
 
 getAlgorithm ()
 
 getAllowedUserCount ()
 
 getCourses ()
 
 getId ()
 
 getInfoText ()
 
 getInstituteIds ()
 
 isGlobal ()
 
 getName ()
 
 getPriorities ()
 
 getNumApplicants ()
 
 getPrivate ()
 
 getSemester ()
 
 getUserId ()
 
 setUserId ($user_id)
 
 getUserLists ()
 
 getUserFactorList ()
 
 hasAlgorithmRun ()
 
 load ()
 
 removeCourse ($courseId)
 
 removeAdmissionRule ($ruleId)
 
 removeInstitute ($instituteId)
 
 removeUserlist ($listId)
 
 setAdmissionRules ($newRules)
 
 setAlgorithm ($newAlgorithm)
 
 setCourses ($newIds)
 
 setInstitutes ($newIds)
 
 setInfoText ($newText)
 
 setName ($newName)
 
 setPrivate ($newPrivate)
 
 setUserlists ($newIds)
 
 store ()
 
 toString ($short=false)
 
 __toString ()
 
 isUserAllowedToAssignCourse ($user_id, $course_id)
 
 isUserAllowedToEdit ($user_id)
 
 isAdmissionRuleAllowed ($admission_rule)
 
 __clone ()
 

Static Public Member Functions

static getCoursesByCourseSetId ($courseSetId)
 
static getCoursesetsByInstituteId ($instituteId, $filter=array())
 
static getGlobalCoursesets ($filter=array())
 
static getSetForCourse ($courseId)
 
static getSetForRule ($rule_id)
 
static getGlobalLockedAdmissionSetId ()
 
static addCourseToSet ($set_id, $course_id)
 
static removeCourseFromSet ($set_id, $course_id)
 

Protected Attributes

 $admissionRules = array()
 
 $algorithm = null
 
 $courses = array()
 
 $hasAlgorithmRun = false
 
 $id = ''
 
 $infoText = ''
 
 $institutes = array()
 
 $name = ''
 
 $private = false
 
 $user_id = false
 
 $userlists = array()
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $setId = '')
Here is the call graph for this function:

Member Function Documentation

◆ __clone()

__clone ( )

◆ __toString()

__toString ( )
Here is the call graph for this function:

◆ addAdmissionRule()

addAdmissionRule (   $rule)

Adds the given admission rule to the list of rules for the course set.

Parameters
AdmissionRulerule
Returns
CourseSet
Here is the caller graph for this function:

◆ addCourse()

addCourse (   $courseId)

Adds the course with the given ID to the course set.

Parameters
StringcourseId
Returns
CourseSet

◆ addCourseToSet()

static addCourseToSet (   $set_id,
  $course_id 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addInstitute()

addInstitute (   $newId)

Adds a new institute ID.

Parameters
StringnewId
Returns
CourseSet
Here is the caller graph for this function:

◆ addInstitutes()

addInstitutes (   $newIds)

Adds several institute IDs to the existing institute assignments.

Parameters
ArraynewIds
Returns
CourseSet
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addUserList()

addUserList (   $listId)

Adds a UserList to the course set. The list contains several users and a factor that changes seat distribution chances for these users;

Parameters
StringlistId
Returns
CourseSet

◆ checkAdmission()

checkAdmission (   $userId,
  $courseId 
)

Is the given user allowed to register as participant in the given course according to the rules of this course set?

Parameters
StringuserId
StringcourseId
Returns
Array Optional error messages from rules if something went wrong.

◆ clearAdmissionRules()

clearAdmissionRules ( )

Removes all admission rules at once.

Returns
CourseSet

◆ delete()

delete ( )

Deletes the course set and all associated data.

Here is the call graph for this function:

◆ distributeSeats()

distributeSeats ( )

Starts the seat distribution algorithm.

Returns
CourseSet
Here is the call graph for this function:

◆ getAdmissionRule()

getAdmissionRule (   $class_name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAdmissionRules()

getAdmissionRules ( )

Get all admission rules belonging to the course set.

Returns
AdmissionRule[]
Here is the caller graph for this function:

◆ getAlgorithm()

getAlgorithm ( )

Get the currently used distribution algorithm.

Returns
AdmissionAlgorithm
Here is the caller graph for this function:

◆ getAllowedUserCount()

getAllowedUserCount ( )

How many users will be allowed to register according to the defined rules? This can help in estimating whether the combination of the defined rules makes sense.

Returns
int

◆ getCourses()

getCourses ( )

Gets the course IDs belonging to the course set.

Returns
Array
Here is the caller graph for this function:

◆ getCoursesByCourseSetId()

static getCoursesByCourseSetId (   $courseSetId)
static

Gets all courses belonging to the given course set ID.

Parameters
String$courseSetId
Returns
Array
Here is the call graph for this function:

◆ getCoursesetsByInstituteId()

static getCoursesetsByInstituteId (   $instituteId,
  $filter = array() 
)
static

Gets all course sets belonging to the given institute ID.

Parameters
String$instituteId
Returns
Array
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGlobalCoursesets()

static getGlobalCoursesets (   $filter = array())
static

Gets all global course sets

Parameters
array$filter
Returns
Array
Here is the call graph for this function:

◆ getGlobalLockedAdmissionSetId()

static getGlobalLockedAdmissionSetId ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getId()

getId ( )

Get the identifier of the course set.

Returns
String
Here is the caller graph for this function:

◆ getInfoText()

getInfoText ( )

Get the course set's info text.

Returns
String

◆ getInstituteIds()

getInstituteIds ( )

Which institutes does the rule belong to?

Returns
Array
Here is the caller graph for this function:

◆ getName()

getName ( )

Gets this course set's display name.

◆ getNumApplicants()

getNumApplicants ( )
Here is the call graph for this function:

◆ getPriorities()

getPriorities ( )

Retrieves the priorities given to the courses in this set.

Returns
Array
Here is the call graph for this function:

◆ getPrivate()

getPrivate ( )

Is the current courseset private?

Returns
bool
Here is the caller graph for this function:

◆ getSeatDistributionTime()

getSeatDistributionTime ( )

returns timestamp of distribution time or null if no distribution time available may return 0 if first-come-first-serve is enabled

Returns
integer|null timestamp of distribution
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSemester()

getSemester ( )

returns latest semester id from assigned courses if no courses are assigned current semester

Returns
string id of semester
Here is the call graph for this function:

◆ getSetForCourse()

static getSetForCourse (   $courseId)
static

Gets the course sets the given course belongs to.

Parameters
StringcourseId
Returns
CourseSet
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSetForRule()

static getSetForRule (   $rule_id)
static

Gets the course sets the given rule belongs to.

Parameters
String$rule_id
Returns
CourseSet
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUserFactorList()

getUserFactorList ( )
Here is the call graph for this function:

◆ getUserId()

getUserId ( )

Gets the owner of this course set.

Here is the caller graph for this function:

◆ getUserLists()

getUserLists ( )

Retrieves the lists of users that are considered specially in seat distribution.

Returns
Array
Here is the caller graph for this function:

◆ hasAdmissionRule()

hasAdmissionRule (   $rule)

check if course set has given admission rule

Parameters
string$rulename of AdmissionRule class
Returns
boolean
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasAlgorithmRun()

hasAlgorithmRun ( )

Evaluates whether the seat distribution algorithm has already been executed on this course set.

Returns
boolean True if algorithm has already run, otherwise false.
Here is the caller graph for this function:

◆ isAdmissionRuleAllowed()

isAdmissionRuleAllowed (   $admission_rule)

checks if given rule is allowed to be added to current set of rules

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

◆ isGlobal()

isGlobal ( )
Here is the caller graph for this function:

◆ isSeatDistributionEnabled()

isSeatDistributionEnabled ( )

returns true if the set allows only a limited number of places

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

◆ isUserAllowedToAssignCourse()

isUserAllowedToAssignCourse (   $user_id,
  $course_id 
)

is user with given user id allowed to assign/unassign given course to courseset

Parameters
string$user_id
string$course_id
Returns
boolean
Here is the call graph for this function:

◆ isUserAllowedToEdit()

isUserAllowedToEdit (   $user_id)

is user with given user id allowed to edit or delete the courseset

Parameters
string$user_id
Returns
boolean
Here is the call graph for this function:

◆ load()

load ( )

Helper function for loading data from DB.

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

◆ removeAdmissionRule()

removeAdmissionRule (   $ruleId)

Removes the rule with the given ID from the set.

Parameters
StringruleId
Returns
CourseSet

◆ removeCourse()

removeCourse (   $courseId)

Removes the course with the given ID from the set.

Parameters
StringcourseId
Returns
CourseSet

◆ removeCourseFromSet()

static removeCourseFromSet (   $set_id,
  $course_id 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeInstitute()

removeInstitute (   $instituteId)

Removes the institute with the given ID from the set.

Parameters
StringinstituteId
Returns
CourseSet

◆ removeUserlist()

removeUserlist (   $listId)

Removes the user list with the given ID from the set.

Parameters
StringlistId
Returns
CourseSet

◆ setAdmissionRules()

setAdmissionRules (   $newRules)

Adds several admission rules after clearing the existing rule assignments.

Parameters
ArraynewIds
Returns
CourseSet
Here is the call graph for this function:

◆ setAlgorithm()

setAlgorithm (   $newAlgorithm)

Sets a seat distribution algorithm for this course set. This will only have an effect in conjunction with a TimedAdmission, as the algorithm needs a defined point in time where it will start.

Parameters
StringnewAlgorithm
Returns
CourseSet
Here is the caller graph for this function:

◆ setAlgorithmRun()

setAlgorithmRun (   $state)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCourses()

setCourses (   $newIds)

Adds several course IDs after clearing the existing course assignments.

Parameters
ArraynewIds
Returns
CourseSet

◆ setInfoText()

setInfoText (   $newText)

Set the course set's info text.

Returns
CourseSet

◆ setInstitutes()

setInstitutes (   $newIds)

Adds several institute IDs after clearing the existing institute assignments.

Parameters
ArraynewIds
Returns
CourseSet
Here is the call graph for this function:

◆ setName()

setName (   $newName)

◆ setPrivate()

setPrivate (   $newPrivate)

Set a new value for courseset privacy.

Parameters
bool$newPrivate
Returns
CourseSet

◆ setUserId()

setUserId (   $user_id)

◆ setUserlists()

setUserlists (   $newIds)

Adds several user list IDs after clearing the existing user list assignments.

Parameters
ArraynewIds
Returns
CourseSet

◆ store()

store ( )
Here is the call graph for this function:

◆ toString()

toString (   $short = false)

A textual description of the current rule.

Parameters
boolshort Show only short info without overview of assigned courses and institutes.
Returns
String
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ $admissionRules

$admissionRules = array()
protected

Admission rules that are applied to the courses belonging to this set.

◆ $algorithm

$algorithm = null
protected

Seat distribution algorithm.

◆ $courses

$courses = array()
protected

IDs of courses that are aggregated into this set. The array is in the form ($courseId1 => true, $courseId2 => true).

◆ $hasAlgorithmRun

$hasAlgorithmRun = false
protected

Has the seat distribution algorithm already been executed?

◆ $id

$id = ''
protected

Unique identifier for this set.

◆ $infoText

$infoText = ''
protected

Some extensive descriptional text for informing confused students.

◆ $institutes

$institutes = array()
protected

Which Stud.IP institute does the course set belong to?

◆ $name

$name = ''
protected

Some display name for this course set.

◆ $private

$private = false
protected

Is the course set only visible for the creator?

◆ $user_id

$user_id = false
protected

Who owns this course set?

◆ $userlists

$userlists = array()
protected

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