Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
blog_filter Class Reference

Abstract class for blog_filter objects. More...

Inheritance diagram for blog_filter:
blog_filter_context blog_filter_entry blog_filter_search blog_filter_since blog_filter_tag blog_filter_user

Public Member Functions

 __construct ($id, $type=null)
 

Static Public Member Functions

static get_instance ($id, $type)
 TODO This is poor design. More...
 

Public Attributes

array $availabletypes = array()
 An array of strings representing the available filter types for each blog_filter. More...
 
array $conditions = array()
 An array of WHERE conditions $conditions.
 
int $id
 The unique ID for a filter's associated record $id.
 
 $overrides = array()
 An array of filter types which this particular filter type overrides: their conditions will not be evaluated.
 
array $params = array()
 An array of SQL params $params.
 
array $tables = array()
 An array of table aliases that are used in the WHERE conditions $tables.
 
string $type
 The type of filter (for example, types of blog_filter_context are site, course and module) $type.
 

Detailed Description

Abstract class for blog_filter objects.

A set of core filters are implemented here. To write new filters, you need to subclass blog_filter and give it the name of the type you want (for example, blog_filter_entry). The blog_filter abstract class will automatically use it when the filter is added to the URL. The first parameter of the constructor is the ID of your filter, but it can be a string or have any other meaning you wish it to have. The second parameter is called $type and is used as a sub-type for filters that have a very similar implementation (see blog_filter_context for an example)

Member Function Documentation

◆ get_instance()

static blog_filter::get_instance (   $id,
  $type 
)
static

TODO This is poor design.

A parent class should not know anything about its children. The default case helps to resolve this design issue

Member Data Documentation

◆ $availabletypes

array blog_filter::$availabletypes = array()

An array of strings representing the available filter types for each blog_filter.

$availabletypes


The documentation for this class was generated from the following file: