FacturaScripts

ListViewFiltersTrait

Description of ListViewFiltersTrait

Tags
author

Carlos Garcia Gomez [email protected]

Table of Contents

$filters  : array<string|int, BaseFilter>
Filter configuration preset by the user
$pageFilterKey  : int
Predefined filter values selected
$pageFilters  : array<string|int, PageFilter>
List of predefined filter values
$showFilters  : bool
addFilterAutocomplete()  : mixed
Add an autocomplete type filter to the ListView.
addFilterCheckbox()  : mixed
Adds a boolean condition type filter to the ListView.
addFilterDatePicker()  : mixed
Adds a date type filter to the ListView.
addFilterNumber()  : mixed
Adds a numeric type filter to the ListView.
addFilterPeriod()  : mixed
Adds a period type filter to the ListView.
addFilterSelect()  : mixed
Add a select type filter to a ListView.
addFilterSelectWhere()  : mixed
Add a select where type filter to a ListView.
deletePageFilter()  : bool
Removes a saved user filter.
getViewName()  : string
savePageFilter()  : int
Save filter values for user/s.
loadSavedFilters()  : mixed
sortFilters()  : mixed

Properties

Methods

addFilterAutocomplete()

Add an autocomplete type filter to the ListView.

public addFilterAutocomplete(string $key, string $label, string $field, string $table[, string $fieldcode = '' ][, string $fieldtitle = '' ][, array<string|int, mixed> $where = [] ]) : mixed
Parameters
$key : string
$label : string
$field : string
$table : string
$fieldcode : string = ''
$fieldtitle : string = ''
$where : array<string|int, mixed> = []
Return values
mixed

addFilterCheckbox()

Adds a boolean condition type filter to the ListView.

public addFilterCheckbox(string $key[, string $label = '' ][, string $field = '' ][, string $operation = '=' ][, mixed $matchValue = true ][, array<string|int, mixed> $default = [] ]) : mixed
Parameters
$key : string
$label : string = ''
$field : string = ''
$operation : string = '='
$matchValue : mixed = true
$default : array<string|int, mixed> = []
Return values
mixed

addFilterDatePicker()

Adds a date type filter to the ListView.

public addFilterDatePicker(string $key[, string $label = '' ][, string $field = '' ][, string $operation = '>=' ]) : mixed
Parameters
$key : string
$label : string = ''
$field : string = ''
$operation : string = '>='
Return values
mixed

addFilterNumber()

Adds a numeric type filter to the ListView.

public addFilterNumber(string $key[, string $label = '' ][, string $field = '' ][, string $operation = '>=' ]) : mixed
Parameters
$key : string
$label : string = ''
$field : string = ''
$operation : string = '>='
Return values
mixed

addFilterPeriod()

Adds a period type filter to the ListView.

public addFilterPeriod(string $key, string $label, string $field) : mixed

(period + start date + end date)

Parameters
$key : string
$label : string
$field : string
Return values
mixed

addFilterSelect()

Add a select type filter to a ListView.

public addFilterSelect(string $key, string $label, string $field[, array<string|int, mixed> $values = [] ]) : mixed
Parameters
$key : string
$label : string
$field : string
$values : array<string|int, mixed> = []
Return values
mixed

addFilterSelectWhere()

Add a select where type filter to a ListView.

public addFilterSelectWhere(string $key, array<string|int, mixed> $values[, string $label = '' ]) : mixed
Parameters
$key : string
$values : array<string|int, mixed>
$label : string = ''

Example of values: [ ['label' => 'Only active', 'where' => [ new DataBaseWhere('suspended', 'FALSE') ]] ['label' => 'Only suspended', 'where' => [ new DataBaseWhere('suspended', 'TRUE') ]] ['label' => 'All records', 'where' => []], ]

Return values
mixed

deletePageFilter()

Removes a saved user filter.

public deletePageFilter(string $idfilter) : bool
Parameters
$idfilter : string
Return values
bool

savePageFilter()

Save filter values for user/s.

public savePageFilter(Request $request, User $user) : int
Parameters
$request : Request
$user : User
Return values
int

Search results