Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | List of all members
user_filtering Class Reference

User filtering wrapper class. More...

Public Member Functions

 __construct ($fieldnames=null, $baseurl=null, $extraparams=null)
 Contructor. More...
 
 display_active ()
 Print the active filter form.
 
 display_add ()
 Print the add filter form.
 
 get_field ($fieldname, $advanced)
 Creates known user filter if present. More...
 
 get_sql_filter ($extra='', array $params=null)
 Returns sql where statement based on active user filters. More...
 

Public Attributes

user_active_filter_form $_activeform
 
user_add_filter_form $_addform
 
array $_fields
 

Detailed Description

User filtering wrapper class.

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

Constructor & Destructor Documentation

◆ __construct()

user_filtering::__construct (   $fieldnames = null,
  $baseurl = null,
  $extraparams = null 
)

Contructor.

Parameters
array$fieldnamesarray of visible user fields
string$baseurlbase url used for submission/return, null if the same of current page
array$extraparamsextra page parameters

Member Function Documentation

◆ get_field()

user_filtering::get_field (   $fieldname,
  $advanced 
)

Creates known user filter if present.

Parameters
string$fieldname
boolean$advanced
Return values
objectfilter

◆ get_sql_filter()

user_filtering::get_sql_filter (   $extra = '',
array  $params = null 
)

Returns sql where statement based on active user filters.

Parameters
string$extrasql
array$paramsnamed params (recommended prefix ex)
Return values
arraysql string and $params

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