Big Sister
List of all members
DBCapsulator::SearchFilter Class Reference

Search Filter encapsulation. More...

Inheritance diagram for DBCapsulator::SearchFilter:
DBCapsulator

Public Class Methods

SearchFilter new ()
 Create a new SearchFilter.

Public Object Methods

scalar sqlexpr (scalar expr)
 Set or fetch the SQL expression that corresponds with this filter.
void addorder (scalar field, scalar descending)
 Add a field name to the list of fields the search result should be ordered by.
list orderfields (list fields)
 Get or set a list of fields the search results should be ordered by.
boolean isdescending (scalar field, scalar descending)
 Get or set if a field is to be sorted in descending order.
scalar sqlorder ()
 Get the ordering settings as a string ready for inclusion in an SQL SELECT statement.

Additional Inherited Members

- Public Member Functions inherited from DBCapsulator
retval dbcfg (scalar dbcfg)
retval search (scalar filter)
retval getnext ()
retval add (scalar record)
retval delete (scalar record)
retval update (scalar record)
hash getnext_locallysorted (SearchFilter filter)
 Returns the next record from a search.
void clear_sortcache (scalar size)
 Clears and setup the cache used by getnext_locallysorted().
retval schema (scalar name)
retval config (scalar cfg)
retval schemadir (scalar dir)
retval error (scalar msg)
retval database (scalar this, scalar db)
retval connect (scalar this, scalar dbcfg)
retval close ()

Detailed Description

Search Filter encapsulation.

Member Function Documentation

void DBCapsulator::SearchFilter::addorder ( scalar  field,
scalar  descending 
)

Add a field name to the list of fields the search result should be ordered by.

Parameters
fieldThe name of the field that should be added.
descending(optional) must be "1" if order should be descending.
boolean DBCapsulator::SearchFilter::isdescending ( scalar  field,
scalar  descending 
)

Get or set if a field is to be sorted in descending order.

Parameters
fieldThe name of the field.
descending(optional) If set, the descending status is set to this value
Returns
true if the field is to be ordered in descending order, false otherwise
SearchFilter DBCapsulator::SearchFilter::new ( )

Create a new SearchFilter.

list DBCapsulator::SearchFilter::orderfields ( list  fields)

Get or set a list of fields the search results should be ordered by.

Parameters
fields(optional) If set, the list of order field names is set to this list.
Returns
The list of field names.
scalar DBCapsulator::SearchFilter::sqlexpr ( scalar  expr)

Set or fetch the SQL expression that corresponds with this filter.

This expression can be used as is in a SQL SELECT statement.

Parameters
exprString specifying the SQL expression. If this parameter is undefined the current expression is returned without any change.
Returns
The current search filter expression.
scalar DBCapsulator::SearchFilter::sqlorder ( )

Get the ordering settings as a string ready for inclusion in an SQL SELECT statement.

Returns
String with an "ORDER BY" statement or an empty string if no order has been requested.

The documentation for this class was generated from the following file: