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:
Keyword

Class TSqlCriteria

TComponent
   |
   --TSqlCriteria

Direct Known Sub-classes:

Search criteria for TDbDataGateway.

Criteria object for data gateway finder methods. Usage:

  1. $criteria = new TSqlCriteria();
  2. $criteria->Parameters[':name'] = 'admin';
  3. $criteria->Parameters[':pass'] = 'prado';
  4. $criteria->OrdersBy['level'] = 'desc';
  5. $criteria->OrdersBy['name'] = 'asc';
  6. $criteria->Limit = 10;
  7. $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
boolean
int
int
TAttributeCollection
TAttributeCollection
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
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$valuesearch conditions.
Output
Exception

setLimit

public void setLimit (int $value )

Input
int$valuemaximum number of records to return.
Output
Exception

setOffset

public void setOffset (int $value )

Input
int$valuerecord offset.
Output
Exception

setOrdersBy

public void setOrdersBy (mixed $value )

Input
mixed$valueordering clause.
Output
Exception

setParameters

public void setParameters (ArrayAccess $value )

Input
ArrayAccess$valuenamed parameters.
Output
Exception

__toString

public string __toString ()

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