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: 268 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

filter:: (15 methods):
  __construct()
  reset_iterator()
  current()
  key()
  rewind()
  next()
  valid()
  count()
  get_name()
  set_join_type()
  get_join_type()
  add_filter_value()
  sort_filter_values()
  get_filter_values()
  jsonSerialize()


Class: filter  - X-Ref

Class representing a generic filter of any type.

__construct(string $name, ?int $jointype = null, ?array $values = null)   X-Ref
Constructor for the generic filter class.

param: string $name The name of the current filter.
param: int $jointype The join to use when combining the filters.
param: mixed[] $values An array of filter objects to be applied.

reset_iterator()   X-Ref
Reset the iterator position.


current()   X-Ref
Return the current filter value.


key()   X-Ref
Returns the current position of the iterator.

return: int

rewind()   X-Ref
Rewind the Iterator position to the start.


next()   X-Ref
Move to the next value in the list.


valid()   X-Ref
Check if the current position is valid.

return: bool

count()   X-Ref
Return the number of contexts.

return: int

get_name()   X-Ref
Return the name of the filter.

return: string

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_value($value)   X-Ref
Add a value to the filter.

param: mixed $value
return: self

sort_filter_values()   X-Ref
Sort the filter values to ensure reliable, and consistent output.


get_filter_values()   X-Ref
Return the current filter values.

return: mixed[]

jsonSerialize()   X-Ref
Serialize filter.

return: mixed|object