Stud.IP  5.4
UserFilterField Class Reference
Inheritance diagram for UserFilterField:
DatafieldCondition DegreeCondition PermissionCondition SemesterOfStudyCondition StgteilVersionCondition SubjectCondition SubjectConditionAny

Public Member Functions

 __construct ($fieldId='')
 
 checkValue ($values)
 
 delete ()
 
 generateId ()
 
 getCompareOperator ()
 
 getCompareOperatorAsText ()
 
 getId ()
 
 getName ()
 
 getUsers ($restrictions=[])
 
 getUserValues ($userId, $additional=null)
 
 getValidCompareOperators ()
 
 getValidValues ()
 
 getValue ()
 
 load ()
 
 setCompareOperator ($newOperator)
 
 setConditionId ($id)
 
 setValue ($newValue)
 
 store ()
 
 __clone ()
 

Static Public Member Functions

static getParameterizedTypes ()
 
static getAvailableFilterFields ()
 

Data Fields

 $compareOperator = ''
 
 $conditionId = ''
 
 $id = ''
 
 $validCompareOperators = []
 
 $validValues = []
 
 $value = null
 
 $sortOrder = 99
 
 $valuesDbTable = ''
 
 $valuesDbIdField = ''
 
 $valuesDbNameField = ''
 
 $userDataDbTable = ''
 
 $userDataDbField = ''
 
 $relations = []
 

Static Public Attributes

static $isParameterized = false
 

Static Protected Attributes

static $cached_valid_values
 
static $available_filter_fields
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $fieldId = '')

Standard constructor.

Parameters
String$fieldIdIf a fieldId is given, the corresponding data is loaded from database.

Member Function Documentation

◆ __clone()

__clone ( )

◆ checkValue()

checkValue (   $values)

Checks whether the given value fits the configured condition. The value is compared to the currently selected value by using the currently selected compare operator.

Parameters
Arrayvalues
Returns
Boolean

◆ delete()

delete ( )

Deletes the stored data for this condition field from DB.

◆ generateId()

generateId ( )

Generate a new unique ID.

Parameters
StringtableName

◆ getAvailableFilterFields()

static getAvailableFilterFields ( )
static

Reads all available UserFilterField subclasses and loads their definitions.

◆ getCompareOperator()

getCompareOperator ( )

Which compare operator is set?

Returns
String

◆ getCompareOperatorAsText()

getCompareOperatorAsText ( )

Which compare operator is set?

Returns
String

◆ getId()

getId ( )

Field ID.

Returns
String

◆ getName()

getName ( )

Get this field's display name.

Returns
String

◆ getParameterizedTypes()

static getParameterizedTypes ( )
static

◆ getUsers()

getUsers (   $restrictions = [])

Compares all the users' values by using the specified compare operator and returns all users that fulfill the condition. This can be an important information when checking on validity of a combination of conditions.

Parameters
Array$restrictionsvalues from other fields that restrict the valid values for a user (e.g. a semester of study in a given subject)
Returns
Array All users that are affected by the current condition field.

◆ getUserValues()

getUserValues (   $userId,
  $additional = null 
)

Gets the value for the given user that is relevant for this condition field. Here, this method looks up the study degree(s) for the user. These can then be compared with the required degrees whether they fit.

Parameters
String$userIdUser to check.
array$additionalconditions that are required for check.
Returns
array The value(s) for this user.

◆ getValidCompareOperators()

getValidCompareOperators ( )

Returns all valid compare operators.

Returns
Array Array of valid compare operators.

◆ getValidValues()

getValidValues ( )

Returns all valid values. Values can be loaded dynamically from database or be returned as static array.

Returns
Array Valid values in the form $value => $displayname.

◆ getValue()

getValue ( )

Which value is set?

Returns
String

◆ load()

load ( )

Helper function for loading data from DB.

◆ setCompareOperator()

setCompareOperator (   $newOperator)

Sets a new selected compare operator

Parameters
StringnewOperator
Returns
UserFilterField

◆ setConditionId()

setConditionId (   $id)

Connects the current field to a UserFilter.

Parameters
String$idID of a UserFilter object.
Returns
UserFilterField

◆ setValue()

setValue (   $newValue)

Sets a new selected value.

Parameters
StringnewValue
Returns
UserFilterField

◆ store()

store ( )

Stores data to DB.

Parameters
StringconditionId The condition this field belongs to.

Field Documentation

◆ $available_filter_fields

$available_filter_fields
staticprotected

◆ $cached_valid_values

$cached_valid_values
staticprotected

◆ $compareOperator

$compareOperator = ''

Which of the valid compare operators is currently chosen?

◆ $conditionId

$conditionId = ''

ID of the UserFilter this field belongs to.

◆ $id

$id = ''

Unique ID for this condition field.

◆ $isParameterized

$isParameterized = false
static

◆ $relations

$relations = []

◆ $sortOrder

$sortOrder = 99

◆ $userDataDbField

$userDataDbField = ''

◆ $userDataDbTable

$userDataDbTable = ''

◆ $validCompareOperators

$validCompareOperators = []

The set of valid compare operators.

◆ $validValues

$validValues = []

All valid values for this field.

◆ $value

$value = null

Which of the valid values is currently chosen?

◆ $valuesDbIdField

$valuesDbIdField = ''

◆ $valuesDbNameField

$valuesDbNameField = ''

◆ $valuesDbTable

$valuesDbTable = ''

Database tables and fields to get valid values and concrete user values from.


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