Show / Hide Table of Contents

Class Cache

Cache to often used db tables and structures and retrieve them in a useful and structured fashion

Syntax

Constructors

Cache()

Initializes a new instance of the Cache class.

Declaration
Cache

Methods

eof()

Checks if there are no more fields in the result.

Declaration
Bool eof()
Returns
Type Description
Bool

True if it is at end of file or there are no more fields to iterate through; otherwise, false.

Remarks

A common usage is in the condition section in a for loop.

first()

Sets the iterator variable to the first field in the field set.

Declaration
Bool first()
Returns
Type Description
Bool

False if the field set is empty; otherwise, true.

getData(String)

This function will return data from a cached table.

Declaration
String getData(String tableId)
Parameters
Type Name Description
String tableId

The table to return data from.

Returns
Type Description
String

Data from the cached table specified in tableId.

getDataSubset(String,String,String)

Returns a subset of the data for a cached table based on a filter, where a field must have a given value.

Declaration
getDataSubset(String tableId, String filterField, String filterValue)
Parameters
Type Name Description
String tableId

The table to return.

String filterField

The field to use for filtering.

String filterValue

The value to compare filterField with to include a row.

Returns
Type Description
String

The rows from the table where filterField = filterValue.

getRow()

Returns a row of fields.

Declaration
Map getRow()
Returns
Type Description
Map

A row of fields.

next()

Sets the iterator to the next field.

Declaration
Bool next()
Returns
Type Description
Bool

False if at end of file or the field set is empty; otherwise, true.

sort(String,Bool)

Sorts the cached data by given field in given order.

Declaration
sort(String field, Bool order)
Parameters
Type Name Description
String field

The field to sort by

Bool order

False will sort in an ascending order, true in a descending order.

Returns
Type Description
In This Article
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top