|
| __construct (int $courseid=0, int $categoryid=0, string $tab='', int $page=0, int $perpage=0, string $url='', string $target='') |
| filter constructor.
|
|
| can_access (\context $context=null, string $capability='') |
| Check whether the user has appropriate permissions on the supplied context.
|
|
| get_course_sql (string $alias='', bool $onlycondition=false) |
| Get any course and category sql fragment and parameters and return as an array for this filter.
|
|
| get_errormessage () |
| Return the error message data.
|
|
| has_capability_in_context (string $capability, context $context=null) |
| Check the specified capability against the filter's context, or the specified context with the filter's information.
|
|
| has_course_filters () |
| Return true if filter has course filter data, and the data is valid.
|
|
| validate_filters () |
| Validate the filters.
|
|
|
int | $categoryid |
| Possible category id being filtered.
|
|
int | $courseid |
| Possible course id being filtered.
|
|
array | $courseids |
| Array of filtered course ids if more than one.
|
|
int | $page |
| The page number if multiple pages.
|
|
int | $perpage |
| Number of items per page for multiple pages.
|
|
string | $tab |
| The tab (page) being accessed.
|
|
string | $target |
| The output target.
|
|
string | $url |
| The url of the page being accessed.
|
|
|
string | $errormessage |
| Any error message if present.
|
|
◆ __construct()
tool_brickfield\local\tool\filter::__construct |
( |
int | $courseid = 0, |
|
|
int | $categoryid = 0, |
|
|
string | $tab = '', |
|
|
int | $page = 0, |
|
|
int | $perpage = 0, |
|
|
string | $url = '', |
|
|
string | $target = '' ) |
filter constructor.
- Parameters
-
int | $courseid | |
int | $categoryid | |
string | $tab | |
int | $page | |
int | $perpage | |
string | $url | |
string | $target | |
◆ can_access()
tool_brickfield\local\tool\filter::can_access |
( |
\context | $context = null, |
|
|
string | $capability = '' ) |
Check whether the user has appropriate permissions on the supplied context.
Determine the capability to check by the filters that are set.
- Parameters
-
context | null | $context | The context being viewed (e.g. system, course category, course). |
string | $capability | An optional capability to check. |
- Return values
-
- Exceptions
-
◆ get_course_sql()
tool_brickfield\local\tool\filter::get_course_sql |
( |
string | $alias = '', |
|
|
bool | $onlycondition = false ) |
Get any course and category sql fragment and parameters and return as an array for this filter.
Return false if course filters are invalid.
- Parameters
-
string | $alias | Optional field alias to prefix on the where condition. |
bool | $onlycondition | Set to true if this is the only condition to be used in the SQL statement. |
- Return values
-
- Exceptions
-
◆ get_errormessage()
tool_brickfield\local\tool\filter::get_errormessage |
( |
| ) |
|
Return the error message data.
- Return values
-
◆ has_capability_in_context()
tool_brickfield\local\tool\filter::has_capability_in_context |
( |
string | $capability, |
|
|
context | $context = null ) |
Check the specified capability against the filter's context, or the specified context with the filter's information.
- Parameters
-
string | $capability | |
null | $context | |
- Return values
-
- Exceptions
-
◆ has_course_filters()
tool_brickfield\local\tool\filter::has_course_filters |
( |
| ) |
|
Return true if filter has course filter data, and the data is valid.
Note that the site uses courseid 1.
- Return values
-
- Exceptions
-
◆ validate_filters()
tool_brickfield\local\tool\filter::validate_filters |
( |
| ) |
|
Validate the filters.
Set an errormessage if invalid. No filters is also valid - in that case using entire system.
- Return values
-
- Exceptions
-
The documentation for this class was generated from the following file:
- admin/tool/brickfield/classes/local/tool/filter.php