MIDDAG for Moodle

user_filter_accessed extends user_filter_type

Table of Contents

Properties

$_advanced  : mixed
$_label  : mixed
$_name  : mixed
$disableelements  : array<string|int, mixed>
list of all the fields which needs to be disabled, if checkbox is checked.
$field  : mixed
name of user table field/fields on which data needs to be compared.

Methods

__construct()  : mixed
Constructor, initalize user_filter_type and sets $disableelements array with list of elements to be diabled by checkbox.
check_data()  : mixed
Retrieves data from the form data.
get_label()  : string
Returns a human friendly description of the filter used as label.
get_sql_filter()  : array<string|int, mixed>
Returns the condition to be used with SQL where.
setupForm()  : void
Adds controls specific to this filter in the form.

Properties

$disableelements

list of all the fields which needs to be disabled, if checkbox is checked.

protected array<string|int, mixed> $disableelements = []

$field

name of user table field/fields on which data needs to be compared.

protected mixed $field

Methods

__construct()

Constructor, initalize user_filter_type and sets $disableelements array with list of elements to be diabled by checkbox.

public __construct(string $name, string $label, bool $advanced, mixed $field[, array<string|int, mixed> $disableelements = null ]) : mixed
Parameters
$name : string

the name of the filter instance

$label : string

the label of the filter instance

$advanced : bool

advanced form element flag

$field : mixed

user table field/fields name for comparison

$disableelements : array<string|int, mixed> = null

name of fields which should be disabled if this checkbox is checked

check_data()

Retrieves data from the form data.

public check_data(object $formdata) : mixed
Parameters
$formdata : object

data submited with the form

Return values
mixed

array filter data or false when filter not set

get_label()

Returns a human friendly description of the filter used as label.

public get_label(array<string|int, mixed> $data) : string
Parameters
$data : array<string|int, mixed>

filter settings

Return values
string

active filter label

get_sql_filter()

Returns the condition to be used with SQL where.

public get_sql_filter(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

filter settings

Return values
array<string|int, mixed>

sql string and $params

setupForm()

Adds controls specific to this filter in the form.

public setupForm(moodleform &$mform) : void
Parameters
$mform : moodleform

a MoodleQuickForm object in which element will be added


        
On this page

Search results