Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
user_filter_select Class Reference

Generic filter based on a list of values. More...

Inheritance diagram for user_filter_select:
user_filter_type

Public Member Functions

 __construct ($name, $label, $advanced, $field, $options, $default=null)
 Constructor.
 
 check_data ($formdata)
 Retrieves data from the form data.
 
 get_label ($data)
 Returns a human friendly description of the filter used as label.
 
 get_operators ()
 Returns an array of comparison operators.
 
 get_sql_filter ($data)
 Returns the condition to be used with SQL where.
 
 setupForm (&$mform)
 Adds controls specific to this filter in the form.
 
 user_filter_select ($name, $label, $advanced, $field, $options, $default=null)
 Old syntax of class constructor.
 
 user_filter_type ($name, $label, $advanced)
 Old syntax of class constructor.
 

Public Attributes

bool $_advanced
 Advanced form element flag.
 
mixed null $_default
 
string $_field
 
string $_label
 The label of this filter instance.
 
string $_name
 The name of this filter instance.
 
array $_options
 options for the list values
 

Detailed Description

Generic filter based on a list of values.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

user_filter_select::__construct ( $name,
$label,
$advanced,
$field,
$options,
$default = null )

Constructor.

Parameters
string$namethe name of the filter instance
string$labelthe label of the filter instance
boolean$advancedadvanced form element flag
string$fielduser table filed name
array$optionsselect options
mixed$defaultoption

Member Function Documentation

◆ check_data()

user_filter_select::check_data ( $formdata)

Retrieves data from the form data.

Parameters
stdClass$formdatadata submited with the form
Return values
mixedarray filter data or false when filter not set

Reimplemented from user_filter_type.

◆ get_label()

user_filter_select::get_label ( $data)

Returns a human friendly description of the filter used as label.

Parameters
array$datafilter settings
Return values
stringactive filter label

Reimplemented from user_filter_type.

◆ get_operators()

user_filter_select::get_operators ( )

Returns an array of comparison operators.

Return values
arrayof comparison operators

◆ get_sql_filter()

user_filter_select::get_sql_filter ( $data)

Returns the condition to be used with SQL where.

Parameters
array$datafilter settings
Return values
arraysql string and $params

Reimplemented from user_filter_type.

◆ setupForm()

user_filter_select::setupForm ( & $mform)

Adds controls specific to this filter in the form.

Parameters
moodleform$mforma MoodleForm object to setup

Reimplemented from user_filter_type.

◆ user_filter_select()

user_filter_select::user_filter_select ( $name,
$label,
$advanced,
$field,
$options,
$default = null )

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated
since Moodle 3.1

◆ user_filter_type()

user_filter_type::user_filter_type ( $name,
$label,
$advanced )
inherited

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated
since Moodle 3.1

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