include/ListView/ListViewData.php

Show: inherited
Table of Contents

\ListViewData

Package: SugarCRM

Data set for ListView

Api
 

Properties

Propertypublic  $additionalDetails= 'true'
Default valuetrueDetails
Type
n/a
Propertypublic  $additionalDetailsAjax= 'true'
Default valuetrueDetails
Type
n/a
Propertypublic  $additionalDetailsAllow= 'null'
Default valuenullDetails
Type
n/a
Propertypublic  $additionalDetailsFieldToAdd= ''NAME''
Default value'NAME'Details
Type
n/a
Propertypublic  $base_url= 'null'
Default valuenullDetails
Type
n/a
Propertypublic  $count_query= ''''
Default value''Details
Type
n/a
Propertypublic  $listviewName= 'null'
Default valuenullDetails
Type
n/a

Methods

methodpublicListViewData( ) : \ListViewData

Constructor sets the limitName to look up the limit in $sugar_config

Returns
Type Description
\ListViewData
methodpublicgenerateURLS( int $sortOrder, int $offset, int $prevOffset, int $nextOffset, int $endOffset, int $totalCounted ) : array

generates urls for use by the display layer

Parameters
Name Type Description
$sortOrder int
$offset int
$prevOffset int
$nextOffset int
$endOffset int
$totalCounted int
Returns
Type Description
array of urls orderBy and baseURL are always returned the others are only returned according to values passed in.
methodpublicgetAdditionalDetails( \unknown_type $fields, \unknown_type $adFunction, \unknown_type $editAccess ) : array

generates the additional details values

Parameters
Name Type Description
$fields \unknown_type
$adFunction \unknown_type
$editAccess \unknown_type
Returns
Type Description
array string to attach to field
methodpublicgetAdditionalDetailsAjax( \GUID $id ) : array

generates the additional details span to be retrieved via ajax

Parameters
Name Type Description
$id \GUID

id id of the record

Returns
Type Description
array string to attach to field
methodpublicgetBaseURL( ) : STRING

generates the base url without any files in the block variables will not be part of the url

Returns
Type Description
STRING (the base url)
methodpublicgetLimit( ) : INT

gets the limit of how many rows to show per page

Returns
Type Description
INT (the limit)
methodpublicgetListViewData( \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

Parameters
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
Returns
Type Description
\array('data'=> row data, 'pageData' => page data information, 'query' => original query string)
methodpublicgetOffset( ) : INT

returns the current offset

Returns
Type Description
INT (current offset)
methodpublicgetOrderBy(  $orderBy = '',  $direction = '' ) : array

checks the request for the order by and if that is not set then it checks the session for it

Parameters
Name Type Description
$orderBy
$direction
Returns
Type Description
array containing the keys orderBy => field being ordered off of and sortOrder => the sort order of that field
methodpublicgetReverseSortOrder( 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

Parameters
Name Type Description
$current_order STRING

(ASC or DESC) $current_order

Returns
Type Description
STRING (ASC or DESC)
methodpublicgetTotalCount(  $main_query ) : void

Parameters
Name Type Description
$main_query
methodpublicsetVariableName( \unknown_type $baseName,  $where,  $listviewName = null ) : void

based off of a base name it sets base, offset, and order by variable names to retrieve them from requests and sessions

Parameters
Name Type Description
$baseName \unknown_type
$where
$listviewName
Documentation was generated by DocBlox 0.18.1.