Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
core_table\local\filter\filterset Class Reference

Class representing a set of filters. More...

Inheritance diagram for core_table\local\filter\filterset:
core_admin\table\plugin_management_table_filterset core_reportbuilder\table\custom_report_table_filterset core_reportbuilder\table\custom_report_table_view_filterset core_reportbuilder\table\system_report_table_filterset core_user\table\participants_filterset

Public Member Functions

 add_filter (filter $filter)
 Add the specified filter.
 
 add_filter_from_params (string $filtername,... $args)
 Add the specified filter from the supplied params.
 
 check_validity ()
 Confirm whether the filter has been correctly specified.
 
 get_all_filtertypes ()
 Get all filter valid types in an array of filtername => filter class type.
 
 get_filter (string $filtername)
 Get the named filter.
 
 get_filters ()
 Return the current set of filters.
 
 get_join_type ()
 Return the currently specified join type.
 
 has_filter (string $filtername)
 Check whether the filter has been added or not.
 
 jsonSerialize ()
 Serialize filterset.
 
 set_join_type (int $jointype)
 Specify the type of join to employ for the filter.
 

Public Attributes

int const JOINTYPE_ALL = 2
 All of the following match.
 
int const JOINTYPE_ANY = 1
 Any of the following match.
 
int const JOINTYPE_DEFAULT = 2
 The default filter type (ALL)
 
int const JOINTYPE_NONE = 0
 None of the following match.
 

Protected Member Functions

 get_optional_filters ()
 Get the list of optional filters in an array of filtername => filter class type.
 
 get_required_filters ()
 Get the list of required filters in an array of filtername => filter class type.
 

Protected Attributes

array $filters = []
 The list of active filters.
 
array $filtertypes = null
 The list of combined filter types.
 
int $jointype = null
 The join type currently in use.
 
int[] $jointypes
 valid join types
 

Detailed Description

Class representing a set of filters.

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

Member Function Documentation

◆ add_filter()

core_table\local\filter\filterset::add_filter ( filter $filter)

Add the specified filter.

Parameters
filter$filter
Return values
self

◆ add_filter_from_params()

core_table\local\filter\filterset::add_filter_from_params ( string $filtername,
... )

Add the specified filter from the supplied params.

Parameters
string$filternameThe name of the filter to create
mixed[]...$args Additional arguments used to create this filter type
Return values
self

◆ check_validity()

core_table\local\filter\filterset::check_validity ( )

Confirm whether the filter has been correctly specified.

Exceptions
moodle_exception

◆ get_all_filtertypes()

core_table\local\filter\filterset::get_all_filtertypes ( )

Get all filter valid types in an array of filtername => filter class type.

Return values
array

◆ get_filter()

core_table\local\filter\filterset::get_filter ( string $filtername)

Get the named filter.

Parameters
string$filtername
Return values
filter

◆ get_filters()

core_table\local\filter\filterset::get_filters ( )

Return the current set of filters.

Return values
filter[]

◆ get_join_type()

core_table\local\filter\filterset::get_join_type ( )

Return the currently specified join type.

Return values
int

◆ get_optional_filters()

core_table\local\filter\filterset::get_optional_filters ( )
protected

Get the list of optional filters in an array of filtername => filter class type.

Return values
array

Reimplemented in core_user\table\participants_filterset.

◆ get_required_filters()

core_table\local\filter\filterset::get_required_filters ( )
protected

◆ has_filter()

core_table\local\filter\filterset::has_filter ( string $filtername)

Check whether the filter has been added or not.

Parameters
string$filtername
Return values
bool

◆ jsonSerialize()

core_table\local\filter\filterset::jsonSerialize ( )

Serialize filterset.

Return values
mixed|object

◆ set_join_type()

core_table\local\filter\filterset::set_join_type ( int $jointype)

Specify the type of join to employ for the filter.

Parameters
int$jointypeThe join type to use using one of the supplied constants
Return values
self

Member Data Documentation

◆ $jointypes

int [] core_table\local\filter\filterset::$jointypes
protected
Initial value:
= [
]
int const JOINTYPE_NONE
None of the following match.
Definition filterset.php:47
int const JOINTYPE_ALL
All of the following match.
Definition filterset.php:53
int const JOINTYPE_ANY
Any of the following match.
Definition filterset.php:50

valid join types


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