## Class TSqlCriteria

Description

Search criteria for TDbDataGateway.

Criteria object for data gateway finder methods. Usage:

     $criteria = new TDbSqlCriteria;
     $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 103)

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

boolean getIsNamedParameters ()
getLimit (line 140)

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

int getLimit ()
getOffset (line 156)

- return: record offset.
- access: public

int getOffset ()
getOrdersBy (line 112)

- return: ordering clause.
- access: public

TAttributeCollection getOrdersBy ()
getParameters (line 85)

- 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 148)

- access: public

void setLimit (int $value)

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

setOffset (line 164)

- access: public

void setOffset (int $value)

- int $value: record offset.

setOrdersBy (line 120)

- access: public

void setOrdersBy (mixed $value)

- mixed $value: ordering clause.

setParameters (line 93)

- access: public

void setParameters (ArrayAccess $value)

- ArrayAccess $value: named parameters.

__toString (line 172)

- 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 Mon, 21 Apr 2008 11:36:14 -0400 by phpDocumentor 1.3.0RC4