Class TfCriteria
Sets conditions on database queries, used to compose a query.
Use this class to set parameters on database-related actions. Individual conditions are held within the item property, as TfCriteriaItem objects. Criteria holds the basic query parameters and controls how TfCriteriaItem are chained together (eg. with "AND", "OR").
See the Tuskfish Developer Guide for a full explanation and examples.
- TfCriteria uses TfMagicMethods
Copyright: Simon Wilkinson 2013+ (https://tuskfish.biz)
License: GNU General Public License (GPL) V2
Author: Simon Wilkinson simon@isengard.biz
Version: Release: 1.0
Since: 1.0
Uses: trait TfMagicMethods Prevents direct setting of properties / unlisted properties.
Located at trust_path/libraries/tuskfish/class/TfCriteria.php
Methods summary
public
|
|
public
|
#
add(
Add conditions (TfCriteriaItem) to a query. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
setOrderType( string $orderType )
Sets the sort type (ascending or descending) for the primary order column of a result set. |
public
|
|
public
|
#
setSecondaryOrderType( string $secondaryOrderType )
Sets the secondary column to order query results by. |
public
|
|
public
|
Methods used from TfMagicMethods
Properties summary
protected
|
$validator
|
|
protected
array
|
$item
|
#
array()
|
protected
array
|
$condition
|
#
array()
|
protected
string
|
$groupBy
|
#
''
|
protected
integer
|
$limit
|
#
0
|
protected
integer
|
$offset
|
#
0
|
protected
string
|
$order
|
#
''
|
protected
string
|
$orderType
|
#
"DESC"
|
protected
string
|
$secondaryOrder
|
#
''
|
protected
string
|
$secondaryOrderType
|
#
"DESC"
|
protected
array
|
$tag
|
#
array()
|
Magic properties
public
|
$validator
Instance of the Tuskfish data validator class. |
public
array
|
$item
Array of TfCriteriaItem. |
public
array
|
$condition
Array of conditions used to join TfCriteriaItem (AND, OR). |
public
string
|
$groupBy
Column to group results by. |
public
integer
|
$limit
Number of records to retrieve. |
public
integer
|
$offset
Starting point for retrieving records. |
public
string
|
$order
Primary column to sort records by. |
public
string
|
$orderType
Sort ascending (ASC) or descending(DESC). |
public
string
|
$secondaryOrder
secondary column to sort records by. |
public
string
|
$secondaryOrderType
Sort ascending (ASC) or descending (DESC). |
public
array
|
$tag
Array of tag IDs. |