include/ListView/ListViewData.php
\ListViewData
Data set for ListView
- Api
Properties
Methods


ListViewData(
)
:
\ListViewData
Constructor sets the limitName to look up the limit in $sugar_config
Type | Description |
---|---|
\ListViewData |


generateURLS(
int $sortOrder, int $offset, int $prevOffset, int $nextOffset, int $endOffset, int $totalCounted
)
:
array
generates urls for use by the display layer
Name | Type | Description |
---|---|---|
$sortOrder | int | |
$offset | int | |
$prevOffset | int | |
$nextOffset | int | |
$endOffset | int | |
$totalCounted | int |
Type | Description |
---|---|
array | of urls orderBy and baseURL are always returned the others are only returned according to values passed in. |


getAdditionalDetails(
\unknown_type $fields, \unknown_type $adFunction, \unknown_type $editAccess
)
:
array
generates the additional details values
Name | Type | Description |
---|---|---|
$fields | \unknown_type | |
$adFunction | \unknown_type | |
$editAccess | \unknown_type |
Type | Description |
---|---|
array | string to attach to field |


getAdditionalDetailsAjax(
\GUID $id
)
:
array
generates the additional details span to be retrieved via ajax
Name | Type | Description |
---|---|---|
$id | \GUID | id id of the record |
Type | Description |
---|---|
array | string to attach to field |


getBaseURL(
)
:
STRING
generates the base url without any files in the block variables will not be part of the url
Type | Description |
---|---|
STRING | (the base url) |


getLimit(
)
:
INT
gets the limit of how many rows to show per page
Type | Description |
---|---|
INT | (the limit) |


getListViewData(
\SugarBean $seed, string $where, \int:0 $offset
=
-1, \int:-1 $limit
=
-1, \string[]:array() $filter_fields
=
array(), \array:array() $params
=
array(), \string:'id' $id_field
=
'id', $singleSelect
=
true
)
:
\array('data'=>
takes in a seed and creates the list view query based off of that seed if the $limit value is set to -1 then it will use the default limit and offset values
it will return an array with two key values 1. 'data'=> this is an array of row data 2. 'pageData'=> this is an array containg three values a.'ordering'=> array('orderBy'=> the field being ordered by , 'sortOrder'=> 'ASC' or 'DESC') b.'urls'=>array('baseURL'=>url used to generate other urls , 'orderBy'=> the base url for order by //the following may not be set (so check empty to see if they are set) 'nextPage'=> the url for the next group of results, 'prevPage'=> the url for the prev group of results, 'startPage'=> the url for the start of the group, 'endPage'=> the url for the last set of results in the group c.'offsets'=>array( 'current'=>current offset 'next'=> next group offset 'prev'=> prev group offset 'end'=> the offset of the last group 'total'=> the total count (only accurate if totalCounted = true otherwise it is either the total count if less than the limit or the total count + 1 ) 'totalCounted'=> if a count query was used to get the total count
Name | Type | Description |
---|---|---|
$seed | \SugarBean | |
$where | string | |
$offset | \int:0 | |
$limit | \int:-1 | |
$filter_fields | \string[]:array() | |
$params | \array:array() | Potential $params are $params['distinct'] = use distinct key word $params['include_custom_fields'] = (on by default) $params['custom_XXXX'] = append custom statements to query |
$id_field | \string:'id' | |
$singleSelect |
Type | Description |
---|---|
\array('data'=> | row data, 'pageData' => page data information, 'query' => original query string) |


getOrderBy(
$orderBy
=
'', $direction
=
''
)
:
array
checks the request for the order by and if that is not set then it checks the session for it
Name | Type | Description |
---|---|---|
$orderBy | ||
$direction |
Type | Description |
---|---|
array | containing the keys orderBy => field being ordered off of and sortOrder => the sort order of that field |


getReverseSortOrder(
STRING $current_order
)
:
STRING
gets the reverse of the sort order for use on links to reverse a sort order from what is currently used
Name | Type | Description |
---|---|---|
$current_order | STRING | (ASC or DESC) $current_order |
Type | Description |
---|---|
STRING | (ASC or DESC) |