PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TSqlCriteria

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;
TComponent
Extended by TSqlCriteria

Direct known subclasses

TActiveRecordCriteria
Package: System\Data\DataGateway
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Wei Zhuo <weizho[at]gmail[dot]com>
Since: 3.1
Located at Data/DataGateway/TSqlCriteria.php
Methods summary
public
# __construct( string $condition = null, mixed $parameters = array() )

Creates a new criteria with given condition;

Creates a new criteria with given condition;

Parameters

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

Overrides

TComponent::__construct()
public mixed
# getSelect( )

Gets the field list to be placed after the SELECT in the SQL. Default to '*'

Gets the field list to be placed after the SELECT in the SQL. Default to '*'

Returns

mixed

Since

3.1.7
public
# setSelect( mixed $value )

Sets the field list to be placed after the SELECT in the SQL.

Sets the field list to be placed after the SELECT in the SQL.

Different behavior depends on type of assigned value string usage without modification

null will be expanded to full list of quoted table column names (quoting depends on database)

array

  • Column names will be quoted if used as key or value of array
    array('col1', 'col2', 'col2')
    // SELECT `col1`, `col2`, `col3` FROM...
    
  • Column aliasing
array('mycol1' => 'col1', 'mycol2' => 'COUNT(*)')
// SELECT `col1` AS mycol1, COUNT(*) AS mycol2 FROM...
  • NULL and scalar values (strings will be quoted depending on database)
array('col1' => 'my custom string', 'col2' => 1.0, 'col3' => 'NULL')
// SELECT "my custom string" AS `col1`, 1.0 AS `col2`, NULL AS `col3` FROM...
  • If the *-wildcard char is used as key or value, add the full list of quoted table column names
array('col1' => 'NULL', '*')
// SELECT `col1`, `col2`, `col3`, NULL AS `col1` FROM...

Parameters

$value
mixed

Since

3.1.7

See

TDbCommandBuilder::getSelectFieldList()
public string
# getCondition( )

Returns

string
search conditions.
public
# setCondition( string $value )

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

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

Parameters

$value
string
search conditions.
public TAttributeCollection
# getParameters( )

Returns

TAttributeCollection
list of named parameters and values.
public
# setParameters( ArrayAccess $value )

Parameters

$value
ArrayAccess
named parameters.
public boolean
# getIsNamedParameters( )

Returns

boolean
true if the parameter index are string base, false otherwise.
public TAttributeCollection
# getOrdersBy( )

Returns

TAttributeCollection
ordering clause.
public
# setOrdersBy( mixed $value )

Parameters

$value
mixed
ordering clause.
public integer
# getLimit( )

Returns

integer
maximum number of records to return.
public
# setLimit( integer $value )

Parameters

$value
integer
maximum number of records to return.
public integer
# getOffset( )

Returns

integer
record offset.
public
# setOffset( integer $value )

Parameters

$value
integer
record offset.
public string
# __toString( )

Returns

string
string representation of the parameters. Useful for debugging.
Methods inherited from TComponent
__call(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO