## Class TSqlCriteria

Description

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
- version: $Id: TDbSqlCriteria.php 1835 2007-04-03 01:38:15Z wei $
- author: Wei Zhuo <weizho[at]gmail[dot]com>

Located in /Data/DataGateway/TSqlCriteria.php (line 32)

    TComponent
       |
       --TSqlCriteria

Direct descendents

Class | Description
--- | ---
TActiveRecordCriteria | Search criteria for Active Record.

Method Summary
TSqlCriteria __construct ([string $condition = null], [mixed $parameters = array()])
string getCondition ()
boolean getIsNamedParameters ()
int getLimit ()
int getOffset ()
TAttributeCollection getOrdersBy ()
TAttributeCollection getParameters ()
void setCondition (string $value)
void setLimit (int $value)
void setOffset (int $value)
void setOrdersBy (mixed $value)
void setParameters (ArrayAccess $value)
string __toString ()
Methods
Constructor __construct (line 45)

Creates a new criteria with given condition;

- access: public

TSqlCriteria __construct ([string $condition = null], [mixed $parameters = array()])

- string $condition: sql string after the WHERE stanza
- mixed $parameters: named or indexed parameters, accepts as multiple arguments.

getCondition (line 61)

- return: search conditions.
- access: public

string getCondition ()
getIsNamedParameters (line 134)

- return: true if the parameter index are string base, false otherwise.
- access: public

boolean getIsNamedParameters ()
getLimit (line 171)

- return: maximum number of records to return.
- access: public

int getLimit ()
getOffset (line 187)

- return: record offset.
- access: public

int getOffset ()
getOrdersBy (line 143)

- return: ordering clause.
- access: public

TAttributeCollection getOrdersBy ()
getParameters (line 116)

- return: list of named parameters and values.
- access: public

TAttributeCollection getParameters ()
setCondition (line 70)

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

- access: public

void setCondition (string $value)

- string $value: search conditions.

setLimit (line 179)

- access: public

void setLimit (int $value)

- int $value: maximum number of records to return.

setOffset (line 195)

- access: public

void setOffset (int $value)

- int $value: record offset.

setOrdersBy (line 151)

- access: public

void setOrdersBy (mixed $value)

- mixed $value: ordering clause.

setParameters (line 124)

- access: public

void setParameters (ArrayAccess $value)

- ArrayAccess $value: named parameters.

__toString (line 203)

- return: string representation of the parameters. Useful for debugging.
- access: public

string __toString ()

#### Inherited 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()

Documentation generated on Sun, 11 Jan 2009 20:23:50 -0500 by phpDocumentor 1.3.0RC4