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

Public Member Functions

 __construct ($fieldId='')
 
 checkValue ($values)
 
 delete ()
 
 generateId ()
 
 getCompareOperator ()
 
 getCompareOperatorAsText ()
 
 getId ()
 
 getName ()
 
 getUsers ($restrictions=array())
 
 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 = array()
 
 $validValues = array()
 
 $value = null
 
 $valuesDbTable = ''
 
 $valuesDbIdField = ''
 
 $valuesDbNameField = ''
 
 $userDataDbTable = ''
 
 $userDataDbField = ''
 
 $relations = array()
 

Static Public Attributes

static $isParameterized = false
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $fieldId = '')

Standard constructor.

Parameters
String$fieldIdIf a fieldId is given, the corresponding data is loaded from database.
Here is the call graph for this function:

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.

Here is the call graph for this function:

◆ generateId()

generateId ( )

Generate a new unique ID.

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

◆ getAvailableFilterFields()

static getAvailableFilterFields ( )
static

Reads all available UserFilterField subclasses and loads their definitions.

Here is the caller graph for this function:

◆ getCompareOperator()

getCompareOperator ( )

Which compare operator is set?

Returns
String

◆ getCompareOperatorAsText()

getCompareOperatorAsText ( )

Which compare operator is set?

Returns
String
Here is the call graph for this function:

◆ getId()

getId ( )

Field ID.

Returns
String

◆ getName()

getName ( )

Get this field's display name.

Returns
String

◆ getParameterizedTypes()

static getParameterizedTypes ( )
static

◆ getUsers()

getUsers (   $restrictions = array())

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.
Here is the call graph for this function:

◆ 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.
Here is the call graph for this function:

◆ getValidCompareOperators()

getValidCompareOperators ( )

Returns all valid compare operators.

Returns
Array Array of valid compare operators.
Here is the caller graph for this function:

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

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

◆ 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.
Here is the call graph for this function:

Field Documentation

◆ $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 = array()

◆ $userDataDbField

$userDataDbField = ''

◆ $userDataDbTable

$userDataDbTable = ''

◆ $validCompareOperators

$validCompareOperators = array()

The set of valid compare operators.

◆ $validValues

$validValues = array()

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: