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.

(no description)

File Size: 204 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: filter  - X-Ref

Class filter.

__construct(int $courseid = 0, int $categoryid = 0, string $tab = '',int $page = 0, int $perpage = 0, string $url = '', string $target = '')   X-Ref
filter constructor.

param: int $courseid
param: int $categoryid
param: string $tab
param: int $page
param: int $perpage
param: string $url
param: string $target

get_course_sql(string $alias = '', bool $onlycondition = false)   X-Ref
Get any course and category sql fragment and parameters and return as an array for this filter. Return false if course
filters are invalid.

param: string $alias Optional field alias to prefix on the where condition.
param: bool $onlycondition Set to true if this is the only condition to be used in the SQL statement.
return: array|bool

validate_filters()   X-Ref
Validate the filters. Set an errormessage if invalid. No filters is also valid - in that case using entire system.

return: bool

has_course_filters()   X-Ref
Return true if filter has course filter data, and the data is valid. Note that the site uses courseid 1.

return: bool

can_access(\context $context = null, string $capability = '')   X-Ref
Check whether the user has appropriate permissions on the supplied context. Determine the capability to check by the filters
that are set.

param: \context|null $context The context being viewed (e.g. system, course category, course).
param: string $capability An optional capability to check.
return: bool

has_capability_in_context(string $capability, \context $context = null)   X-Ref
Check the specified capability against the filter's context, or the specified context with the filter's information.

param: string $capability
param: null $context
return: bool

get_errormessage()   X-Ref
Return the error message data.

return: mixed