Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | List of all members
user_filter_yesno Class Reference

Generic yes/no filter with radio buttons for integer fields. More...

Inheritance diagram for user_filter_yesno:
user_filter_simpleselect user_filter_type user_filter_anycourses

Public Member Functions

 __construct ($name, $label, $advanced, $field)
 Constructor. More...
 
 check_data ($formdata)
 Retrieves data from the form data. More...
 
 get_label ($data)
 Returns a human friendly description of the filter used as label. More...
 
 get_sql_filter ($data)
 Returns the condition to be used with SQL. More...
 
 setupForm (&$mform)
 Adds controls specific to this filter in the form. More...
 
 user_filter_simpleselect ($name, $label, $advanced, $field, $options)
 Old syntax of class constructor. More...
 
 user_filter_type ($name, $label, $advanced)
 Old syntax of class constructor. More...
 
 user_filter_yesno ($name, $label, $advanced, $field)
 Old syntax of class constructor. More...
 

Public Attributes

bool $_advanced
 Advanced form element flag.
 
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 yes/no filter with radio buttons for integer fields.

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

Constructor & Destructor Documentation

◆ __construct()

user_filter_yesno::__construct (   $name,
  $label,
  $advanced,
  $field 
)

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

Member Function Documentation

◆ check_data()

user_filter_simpleselect::check_data (   $formdata)
inherited

Retrieves data from the form data.

Parameters
object$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_simpleselect::get_label (   $data)
inherited

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

user_filter_yesno::get_sql_filter (   $data)

Returns the condition to be used with SQL.

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

Reimplemented from user_filter_simpleselect.

Reimplemented in user_filter_anycourses.

◆ setupForm()

user_filter_simpleselect::setupForm ( $mform)
inherited

Adds controls specific to this filter in the form.

Parameters
moodleform$mforma MoodleForm object to setup

Reimplemented from user_filter_type.

◆ user_filter_simpleselect()

user_filter_simpleselect::user_filter_simpleselect (   $name,
  $label,
  $advanced,
  $field,
  $options 
)
inherited

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

◆ user_filter_yesno()

user_filter_yesno::user_filter_yesno (   $name,
  $label,
  $advanced,
  $field 
)

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated:
since Moodle 3.1

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