$model
$model :
Model pagination builder
Model paginator is used to select and perform an action on part of models in the model collection.
Here is an example showes how to use the class:
$builder = new Pluf_Paginator_Builder(new Pluf_Model())
->setRequest($request)
->setDisplayFields($displayList) ->setSearchFields($searchFields) ->setSortFields($sortFields)
->setWhereClause($sql) ->setView($viewName);
$paginator = $bulder->build();
$whereClause : \Pluf_SQL
The where clause from the search.
__construct(\Pluf_Model $model = null)
Creates new instance of builder
\Pluf_Model | $model |
setRequest(\Pluf_HTTP_Request $request) : \Pluf_Paginator_Builder
Load setting from request
\Pluf_HTTP_Request | $request |
setDisplayList(array $displayFields)
The fields being shown.
If no fields are given, all readable fields of the model of the item will be used to show the item.
If an item in the list_display is an array the format is the following:
array('field', 'Custom_Function_ToApply', 'custom header name')
array | $displayFields |
setSortFields(array $sortFields) : \Pluf_Paginator_Builder
Which fields of the model can be used to sort the dataset.
To be useable these fields must be in the $list_display so that the sort links can be shown for the user to click on them and sort the list.
array | $sortFields |
setSearchFields(array $searchFields) : \Pluf_Paginator_Builder
Which fields used to search
array | $searchFields |
setWhereClause(\Pluf_SQL $sql) : \Pluf_Paginator_Builder
Additional where clause
\Pluf_SQL | $sql |
setView(string $viewName) : \Pluf_Paginator_Builder
Main model view
string | $viewName |
build() : \Pluf_Paginator
Build a paginator