- Home
- About
- Testimonials
- Demos
- Download
- Documentation
- Blogs
- Forum
- Support

Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml
Classes:
TDataGatewayCommand
TDataGatewayEventParameter
TDataGatewayResultEventParameter
TSqlCriteria
TTableGateway

Keyword

# Class TSqlCriteria

    TComponent
       |
       --TSqlCriteria

#### Direct Known Sub-classes:

TActiveRecordCriteria

Search criteria for TDbDataGateway.

Criteria object for data gateway finder methods. Usage:

     $criteria = new TSqlCriteria();
     $criteria->Parameters[':name'] = 'admin';
     $criteria->Parameters[':pass'] = 'prado';
     $criteria->OrdersBy['level'] = 'desc';
     $criteria->OrdersBy['name'] = 'asc';
     $criteria->Limit = 10;
     $criteria->Offset = 20;

Since: 3.1
Author: Wei Zhuo <weizho[at]gmail[dot]com>

Constructor Summary
public | __construct Array Creates a new criteria with given condition;

Method Summary
string | getCondition ()
boolean | getIsNamedParameters ()
int | getLimit ()
int | getOffset ()
TAttributeCollection | getOrdersBy ()
TAttributeCollection | getParameters ()
void | setCondition ( string $value) Sets the search conditions to be placed after the WHERE clause in the SQL.
void | setLimit ( int $value)
void | setOffset ( int $value)
void | setOrdersBy ( mixed $value)
void | setParameters ( ArrayAccess $value)
string | __toString ()

Methods Inherited From TComponent

TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()

Constructor Details

## __construct

public __construct | Array

Creates a new criteria with given condition;

Method Details

## getCondition

public string getCondition | ()

Output
string | search conditions.
Exception

## getIsNamedParameters

public boolean getIsNamedParameters | ()

Output
boolean | true if the parameter index are string base, false otherwise.
Exception

## getLimit

public int getLimit | ()

Output
int | maximum number of records to return.
Exception

## getOffset

public int getOffset | ()

Output
int | record offset.
Exception

## getOrdersBy

public TAttributeCollection getOrdersBy | ()

Output
TAttributeCollection | ordering clause.
Exception

## getParameters

public TAttributeCollection getParameters | ()

Output
TAttributeCollection | list of named parameters and values.
Exception

## setCondition

public void setCondition | (string $value )

Sets the search conditions to be placed after the WHERE clause in the SQL.

Input
string | $value | search conditions.
Output
Exception

## setLimit

public void setLimit | (int $value )

Input
int | $value | maximum number of records to return.
Output
Exception

## setOffset

public void setOffset | (int $value )

Input
int | $value | record offset.
Output
Exception

## setOrdersBy

public void setOrdersBy | (mixed $value )

Input
mixed | $value | ordering clause.
Output
Exception

## setParameters

public void setParameters | (ArrayAccess $value )

Input
ArrayAccess | $value | named parameters.
Output
Exception

## __toString

public string __toString | ()

Output
string | string representation of the parameters. Useful for debugging.
Exception