$filters
Filter configuration preset by the user
public
\FacturaScripts\Core\Lib\ListFilter\BaseFilter[]
$filters
= []
Description of ListViewFiltersTrait
$filters | Filter configuration preset by the user | \FacturaScripts\Core\Lib\ListFilter\BaseFilter[] |
---|---|---|
$pageFilterKey | Predefined filter values selected | int |
$pageFilters | List of predefined filter values | \FacturaScripts\Dinamic\Model\PageFilter[] |
$showFilters | bool | |
getViewName() | string | |
addFilterAutocomplete() | Add an autocomplete type filter to the ListView. | mixed |
addFilterCheckbox() | Adds a boolean condition type filter to the ListView. | mixed |
addFilterDatePicker() | Adds a date type filter to the ListView. | mixed |
addFilterNumber() | Adds a numeric type filter to the ListView. | mixed |
addFilterPeriod() | Adds a period type filter to the ListView. | mixed |
addFilterSelect() | Add a select type filter to a ListView. | mixed |
addFilterSelectWhere() | Add a select where type filter to a ListView. | mixed |
deletePageFilter() | Removes a saved user filter. | bool |
savePageFilter() | Save filter values for user/s. | int |
loadSavedFilters() | mixed | |
sortFilters() | mixed |
Filter configuration preset by the user
public
\FacturaScripts\Core\Lib\ListFilter\BaseFilter[]
$filters
= []
Predefined filter values selected
public
int
$pageFilterKey
= ""
List of predefined filter values
public
\FacturaScripts\Dinamic\Model\PageFilter[]
$pageFilters
= []
public
bool
$showFilters
= false
public
abstract getViewName(
)
: string
Add an autocomplete type filter to the ListView.
public
addFilterAutocomplete(
$key :
string
, $label :
string
, $field :
string
, $table :
string
[, $fieldcode :
string
= '' ]
[, $fieldtitle :
string
= '' ]
[, $where :
array
= [] ]
)
: mixed
Adds a boolean condition type filter to the ListView.
public
addFilterCheckbox(
$key :
string
[, $label :
string
= '' ]
[, $field :
string
= '' ]
[, $operation :
string
= '=' ]
[, $matchValue :
mixed
= true ]
[, $default :
array
= [] ]
)
: mixed
Adds a date type filter to the ListView.
public
addFilterDatePicker(
$key :
string
[, $label :
string
= '' ]
[, $field :
string
= '' ]
[, $operation :
string
= '>=' ]
)
: mixed
Adds a numeric type filter to the ListView.
public
addFilterNumber(
$key :
string
[, $label :
string
= '' ]
[, $field :
string
= '' ]
[, $operation :
string
= '>=' ]
)
: mixed
Adds a period type filter to the ListView.
public
addFilterPeriod(
$key :
string
, $label :
string
, $field :
string
)
: mixed
(period + start date + end date)
Add a select type filter to a ListView.
public
addFilterSelect(
$key :
string
, $label :
string
, $field :
string
[, $values :
array
= [] ]
)
: mixed
Add a select where type filter to a ListView.
public
addFilterSelectWhere(
$key :
string
, $values :
array
)
: mixed
Example of values: [ ['label' => 'Only active', 'where' => [ new DataBaseWhere('suspended', 'FALSE') ]] ['label' => 'Only suspended', 'where' => [ new DataBaseWhere('suspended', 'TRUE') ]] ['label' => 'All records', 'where' => []], ]
Removes a saved user filter.
public
deletePageFilter(
$idfilter :
string
)
: bool
Save filter values for user/s.
public
savePageFilter(
$request :
Request
, $user :
User
)
: int
private
loadSavedFilters(
$where :
\FacturaScripts\Core\Base\DataBase\DataBaseWhere[]
)
: mixed
private
sortFilters(
)
: mixed