|
static | create (filter $filter) |
| Creates an instance of a filter type, based on supplied report filter instance.
|
|
|
int const | ANY_VALUE = 0 |
|
int const | CONTAINS = 1 |
|
int const | DOES_NOT_CONTAIN = 2 |
|
int const | ENDS_WITH = 6 |
|
int const | IS_EMPTY = 7 |
|
int const | IS_EQUAL_TO = 3 |
|
int const | IS_NOT_EMPTY = 8 |
|
int const | IS_NOT_EQUAL_TO = 4 |
|
int const | STARTS_WITH = 5 |
|
|
filter | $filter |
| $filter
|
|
string | $name |
| $name
|
|
◆ applies_to_values()
core_reportbuilder\local\filters\base::applies_to_values |
( |
array | $values | ) |
|
|
inherited |
Given an array of current filter values for the report, determine whether the filter would apply to the report (i.e.
user has configured it from it's initial "Any value" state). A filter would typically be considered applied if it returns SQL filter clauses, but child classes may override this method if they use different logic
- Parameters
-
- Return values
-
◆ create()
static core_reportbuilder\local\filters\base::create |
( |
filter | $filter | ) |
|
|
staticfinalinherited |
Creates an instance of a filter type, based on supplied report filter instance.
The report filter instance is used by reports/entities to define what should be filtered against, e.g. a SQL fragment
- Parameters
-
filter | $filter | The report filter instance |
- Return values
-
◆ get_entity_name()
core_reportbuilder\local\filters\base::get_entity_name |
( |
| ) |
|
|
finalinherited |
Returns the filter's entity name.
- Return values
-
◆ get_filter_persistent()
core_reportbuilder\local\filters\base::get_filter_persistent |
( |
| ) |
|
|
finalinherited |
Returns the filter persistent.
Note that filters for system reports don't store a persistent and will return null.
- Return values
-
◆ get_header()
core_reportbuilder\local\filters\base::get_header |
( |
| ) |
|
|
finalinherited |
Returns the filter header.
- Return values
-
◆ get_sample_values()
core_reportbuilder\local\filters\text::get_sample_values |
( |
| ) |
|
◆ get_sql_filter() [1/2]
core_reportbuilder\local\filters\base::get_sql_filter |
( |
array | $values | ) |
|
|
abstractinherited |
Returns the filter clauses to be used with SQL where.
Ideally the field SQL should be included only once in the returned expression, however if that is unavoidable then use the {
- See also
- filter\get_field_sql_and_params} helper to ensure uniqueness of any parameters included within
- Parameters
-
- Return values
-
array | [$sql, [...$params]] |
Reimplemented in core_reportbuilder\local\filters\autocomplete, core_reportbuilder\local\filters\boolean_select, core_reportbuilder\local\filters\category, core_reportbuilder\local\filters\course_selector, core_reportbuilder\local\filters\date, core_reportbuilder\local\filters\duration, core_reportbuilder\local\filters\number, core_reportbuilder\local\filters\select, core_reportbuilder\local\filters\tags, and core_reportbuilder\local\filters\user.
◆ get_sql_filter() [2/2]
core_reportbuilder\local\filters\text::get_sql_filter |
( |
?array | $values | ) |
|
Return filter SQL.
- Parameters
-
- Return values
-
array | array of two elements - SQL query and named parameters |
◆ setup_form() [1/2]
core_reportbuilder\local\filters\base::setup_form |
( |
MoodleQuickForm | $mform | ) |
|
|
abstractinherited |
◆ setup_form() [2/2]
core_reportbuilder\local\filters\text::setup_form |
( |
\MoodleQuickForm | $mform | ) |
|
Adds controls specific to this filter in the form.
Operator selector use the "$this->name . '_operator'" naming convention and the fields to enter custom values should use "$this->name . '_value'" or _value1/_value2/... in case there is more than one field for their naming.
- Parameters
-
The documentation for this class was generated from the following file:
- reportbuilder/classes/local/filters/text.php