Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

Table filterset.

Copyright: 2020 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 304 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: filterset  - X-Ref

Class representing a set of filters.

set_join_type(int $jointype)   X-Ref
Specify the type of join to employ for the filter.

param: int $jointype The join type to use using one of the supplied constants
return: self

get_join_type()   X-Ref
Return the currently specified join type.

return: int

add_filter(filter $filter)   X-Ref
Add the specified filter.

param: filter $filter
return: self

add_filter_from_params(string $filtername, ...$args)   X-Ref
Add the specified filter from the supplied params.

param: string $filtername The name of the filter to create
param: mixed[] ...$args Additional arguments used to create this filter type
return: self

get_filters()   X-Ref
Return the current set of filters.

return: filter[]

has_filter(string $filtername)   X-Ref
Check whether the filter has been added or not.

param: string $filtername
return: bool

get_filter(string $filtername)   X-Ref
Get the named filter.

param: string $filtername
return: filter

check_validity()   X-Ref
Confirm whether the filter has been correctly specified.


get_required_filters()   X-Ref
Get the list of required filters in an array of filtername => filter class type.

return: array

get_optional_filters()   X-Ref
Get the list of optional filters in an array of filtername => filter class type.

return: array

get_all_filtertypes()   X-Ref
Get all filter valid types in an array of filtername => filter class type.

return: array

jsonSerialize()   X-Ref
Serialize filterset.

return: mixed|object