ModelList
in package
page: modellist.class.php La classe ModelList aiuta a gestisce la visualizzazione delle tabelle html a partire da una tabella mysql
Table of Contents
Properties
- $db : mixed
- $default_limit : mixed
- $filters : mixed
- $fn_filter : mixed
- $limit : mixed
- $list_structure : mixed
- $order : mixed
- $order_dir : mixed
- $order_field : mixed
- $page : mixed
- $page_info : mixed
- $primary_key : mixed
- $table : mixed
- $table_id : mixed
- $table_structure : mixed
Methods
- __construct() : mixed
- Costruttore della classe ModelList
- add_filter() : mixed
- Aggiunge un filtro di ricerca
- filter_search() : mixed
- Filtra la query per la ricerca
- get_data_chart() : mixed
- Draw chart
- get_list_structure() : mixed
- La struttura delle colonne della tabella
- get_page_info() : PageInfo
- Page_info sono le informazioni che servono alla tabella per funzionare
- get_table_structure() : ListStructure|array<string|int, mixed>|null
- La struttura delle colonne della tabella
- query_from_request() : Query
- Imposta i parametri della richiesta per la query
- set_limit() : mixed
- Setta il limite di righe per pagina
- set_list_structure() : mixed
- La struttura delle colonne della tabella [ 'row_field' => ['type'=>string, 'label' => string, 'primary' => bool] type: hidden, checkbox, text, select; label: il nome della colonna
- set_no_order() : mixed
- Se si chiama questa funzione non viene impostato l'ordinamento
- set_primary_key() : mixed
- set_request() : mixed
Properties
$db
public
mixed
$db
$default_limit
public
mixed
$default_limit
= 10
$filters
public
mixed
$filters
$fn_filter
public
mixed
$fn_filter
= []
$limit
public
mixed
$limit
$list_structure
public
mixed
$list_structure
$order
public
mixed
$order
= true
$order_dir
public
mixed
$order_dir
$order_field
public
mixed
$order_field
$page
public
mixed
$page
$page_info
public
mixed
$page_info
$primary_key
public
mixed
$primary_key
= ''
$table
public
mixed
$table
= ''
$table_id
public
mixed
$table_id
= ''
$table_structure
public
mixed
$table_structure
= null
Methods
__construct()
Costruttore della classe ModelList
public
__construct(string $table[, string|null $table_id = null ][, mixed $db = null ]) : mixed
Parameters
- $table : string
-
Nome della tabella
- $table_id : string|null = null
-
ID della tabella (opzionale)
- $db : mixed = null
add_filter()
Aggiunge un filtro di ricerca
public
add_filter(mixed $filter_type, mixed $fn) : mixed
Parameters
- $filter_type : mixed
- $fn : mixed
filter_search()
Filtra la query per la ricerca
public
filter_search(Query $query, mixed $search) : mixed
Parameters
- $query : Query
- $search : mixed
get_data_chart()
Draw chart
public
get_data_chart(array<string|int, mixed> $data, array<string|int, mixed> $structure) : mixed
Parameters
- $data : array<string|int, mixed>
- $structure : array<string|int, mixed>
-
['label' => 'string', 'axis' => 'x|y'] Deve esserci un solo campo x poi gli altri sono y di default
get_list_structure()
La struttura delle colonne della tabella
public
get_list_structure() : mixed
get_page_info()
Page_info sono le informazioni che servono alla tabella per funzionare
public
get_page_info(int $total) : PageInfo
Parameters
- $total : int
-
Numero totale di record
Return values
PageInfoget_table_structure()
La struttura delle colonne della tabella
public
get_table_structure() : ListStructure|array<string|int, mixed>|null
Return values
ListStructure|array<string|int, mixed>|nullquery_from_request()
Imposta i parametri della richiesta per la query
public
query_from_request([mixed $request = null ]) : Query
Parameters
- $request : mixed = null
Return values
Queryset_limit()
Setta il limite di righe per pagina
public
set_limit(mixed $limit) : mixed
Parameters
- $limit : mixed
set_list_structure()
La struttura delle colonne della tabella [ 'row_field' => ['type'=>string, 'label' => string, 'primary' => bool] type: hidden, checkbox, text, select; label: il nome della colonna
public
set_list_structure(mixed $list_structure) : mixed
Parameters
- $list_structure : mixed
set_no_order()
Se si chiama questa funzione non viene impostato l'ordinamento
public
set_no_order() : mixed
set_primary_key()
public
set_primary_key(mixed $primary_key) : mixed
Parameters
- $primary_key : mixed
set_request()
public
set_request(mixed $request) : mixed
Parameters
- $request : mixed