Stud.IP  5.4
 All Data Structures Namespaces Files Functions Variables Groups
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
 

Constructor & Destructor Documentation

__construct (   $fieldId = '')

Standard constructor.

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

Member Function Documentation

__clone ( )
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 ( )

Deletes the stored data for this condition field from DB.

generateId ( )

Generate a new unique ID.

Parameters
StringtableName
static getAvailableFilterFields ( )
static

Reads all available UserFilterField subclasses and loads their definitions.

getCompareOperator ( )

Which compare operator is set?

Returns
String
getCompareOperatorAsText ( )

Which compare operator is set?

Returns
String
getId ( )

Field ID.

Returns
String
getName ( )

Get this field's display name.

Returns
String
static getParameterizedTypes ( )
static
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 (   $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 ( )

Returns all valid compare operators.

Returns
Array Array of valid compare operators.
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 ( )

Which value is set?

Returns
String
load ( )

Helper function for loading data from DB.

setCompareOperator (   $newOperator)

Sets a new selected compare operator

Parameters
StringnewOperator
Returns
UserFilterField
setConditionId (   $id)

Connects the current field to a UserFilter.

Parameters
String$idID of a UserFilter object.
Returns
UserFilterField
setValue (   $newValue)

Sets a new selected value.

Parameters
StringnewValue
Returns
UserFilterField
store ( )

Stores data to DB.

Parameters
StringconditionId The condition this field belongs to.

Field Documentation

$compareOperator = ''

Which of the valid compare operators is currently chosen?

$conditionId = ''

ID of the UserFilter this field belongs to.

$id = ''

Unique ID for this condition field.

$isParameterized = false
static
$relations = []
$sortOrder = 99
$userDataDbField = ''
$userDataDbTable = ''
$validCompareOperators = []

The set of valid compare operators.

$validValues = []

All valid values for this field.

$value = null

Which of the valid values is currently chosen?

$valuesDbIdField = ''
$valuesDbNameField = ''
$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: