CJoinQuery
Package | system.db.ar |
---|---|
Inheritance | class CJoinQuery |
Since | 1.0 |
Version | $Id: CActiveFinder.php 2231 2010-06-25 21:05:21Z qiang.xue $ |
CJoinQuery represents a JOIN SQL statement.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
conditions | array | list of WHERE clauses | CJoinQuery |
distinct | boolean | whether to select distinct result set | CJoinQuery |
elements | array | list of join element IDs (id=>true) | CJoinQuery |
groups | array | list of GROUP BY clauses | CJoinQuery |
havings | array | list of HAVING clauses | CJoinQuery |
joins | array | list of join statement | CJoinQuery |
limit | integer | row limit | CJoinQuery |
offset | integer | row offset | CJoinQuery |
orders | array | list of ORDER BY clauses | CJoinQuery |
params | array | list of query parameters | CJoinQuery |
selects | array | list of column selections | CJoinQuery |
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Constructor. | CJoinQuery |
createCommand() | Creates the SQL statement. | CJoinQuery |
join() | Joins with another join element | CJoinQuery |
Property Details
conditions
property
public array $conditions;
list of WHERE clauses
distinct
property
(available since v1.0.9)
public boolean $distinct;
whether to select distinct result set
elements
property
public array $elements;
list of join element IDs (id=>true)
groups
property
public array $groups;
list of GROUP BY clauses
havings
property
public array $havings;
list of HAVING clauses
joins
property
public array $joins;
list of join statement
limit
property
public integer $limit;
row limit
offset
property
public integer $offset;
row offset
orders
property
public array $orders;
list of ORDER BY clauses
params
property
public array $params;
list of query parameters
selects
property
public array $selects;
list of column selections
Method Details
__construct()
method
public void __construct(CJoinElement $joinElement, CDbCriteria $criteria=NULL)
| ||
$joinElement | CJoinElement | The root join tree. |
$criteria | CDbCriteria | the query criteria |
Constructor.
createCommand()
method
public string createCommand(CDbCommandBuilder $builder)
| ||
$builder | CDbCommandBuilder | the command builder |
{return} | string | the SQL statement |
Creates the SQL statement.
join()
method
public void join(CJoinElement $element)
| ||
$element | CJoinElement | the element to be joined |
Joins with another join element