Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403]

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: 305 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