ZMObject
└─ZMResultList
public class ZMResultList
extends ZMObject
| Field Summary | |
|---|---|
| protected mixed | |
| protected mixed | |
| protected mixed | |
| protected mixed | |
| protected mixed | |
| protected mixed | |
| protected mixed | |
| Fields inherited from org.zenmagick.core\ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| void | Create new result list. |
| void | addFilter(ZMResultListFilter filter) Add a filter to this result list. |
| void | addSorter(ZMResultListSorter sorter) Add a sorter to this result list. |
| protected array | Actual method to generate the viewable results. |
| array | Get all available results. |
| array | getFilters(boolean active) Get all filter. |
| int | Get the next page number. |
| int | Get the calculated number of pages. |
| int | Count all results. |
| int | Get the page number (1-based). |
| int | Get the configured pagination. |
| int | Get the previous page number. |
| array | Get the results for the current page. |
| array | getSorters(boolean active) Get all configured sorter. |
| boolean | Check if any filter are active. |
| boolean | Check if a next page is available. |
| boolean | Check if a previous page is available. |
| boolean | Checks if there are results available. |
| boolean | Check if any sorter are configured. |
| void | setPageNumber(int page) Set the page number (1-based). |
| void | setPagination(int pagination) Set the configured pagination. |
| void | setResultSource(ZMResultSource resultSource) Set a source for results. |
| Methods inherited from org.zenmagick.core\ZMObject | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
protected mixed $allResults_
protected mixed $filters_
protected mixed $page_
protected mixed $pagination_
protected mixed $resultSource_
protected mixed $results_
protected mixed $sorters_
public void __construct()
Create new result list.
public void addFilter(ZMResultListFilter filter)
Add a filter to this result list.
public void addSorter(ZMResultListSorter sorter)
Add a sorter to this result list.
protected array buildResults()
Actual method to generate the viewable results.
public array getAllResults()
Get all available results.
Please note that depending on the actual implementation this might return the same as
getResults().
public array getFilters(boolean active)
Get all filter.
false
ZMResultListFilter.public int getNextPageNumber()
Get the next page number.
public int getNumberOfPages()
Get the calculated number of pages.
public int getNumberOfResults()
Count all results.
public int getPageNumber()
Get the page number (1-based).
public int getPagination()
Get the configured pagination.
public int getPreviousPageNumber()
Get the previous page number.
public array getResults()
Get the results for the current page.
public array getSorters(boolean active)
Get all configured sorter.
false
ZMResultListSorter.public boolean hasFilters()
Check if any filter are active.
true if filters are configured, false if not.public boolean hasNextPage()
Check if a next page is available.
true if a next page is available, false if not.public boolean hasPreviousPage()
Check if a previous page is available.
true if a previous page is available, false if not.public boolean hasResults()
Checks if there are results available.
true if results are available, false if not.public boolean hasSorters()
Check if any sorter are configured.
true if sorter are configured, false if not.public void setPageNumber(int page)
Set the page number (1-based).
public void setPagination(int pagination)
Set the configured pagination.
public void setResultSource(ZMResultSource resultSource)
Set a source for results.
The advantage of using a result source is that alternative implementations are free to ignore these, modify them or replace them as needed. Providing results via the constructor means that the resources used to build that list might be wasted.
A (result) list that handles lists spanning multiple pages.
A result list operates on any given set of results. Results do not have to have any specific properties, type specific code is delegated to filters and sorters.
Results are obtained via the
ZMResultSourceobject. This defers the actual query to the latest possible moment. Methods may trigger the query if they depend on results; a good example for that is, for example,getNumberOfResults().