CJoinElement
Package | system.db.ar |
---|---|
Inheritance | class CJoinElement |
Since | 1.0 |
Version | $Id: CActiveFinder.php 2231 2010-06-25 21:05:21Z qiang.xue $ |
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
children | array | list of child join elements | CJoinElement |
id | integer | the unique ID of this tree node | CJoinElement |
model | CActiveRecord | the model associated with this tree node | CJoinElement |
rawTableAlias | string | the quoted table alias for this element | CJoinElement |
records | array | list of active records found by the queries. | CJoinElement |
relation | CActiveRelation | the relation represented by this tree node | CJoinElement |
stats | array | list of stat elements | CJoinElement |
tableAlias | string | table alias for this join element | CJoinElement |
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Constructor. | CJoinElement |
afterFind() | Calls CActiveRecord::afterFind of all the records. | CJoinElement |
beforeFind() | Calls CActiveRecord::beforeFind. | CJoinElement |
buildQuery() | Builds the join query with all descendant HAS_ONE and BELONGS_TO nodes. | CJoinElement |
count() | Count the number of primary records returned by the join statement. | CJoinElement |
find() | Performs the recursive finding with the criteria. | CJoinElement |
findWithBase() | Performs the eager loading with the base records ready. | CJoinElement |
getColumnPrefix() | CJoinElement | |
getColumnSelect() | Generates the list of columns to be selected. | CJoinElement |
getJoinCondition() | CJoinElement | |
getPrimaryKeyRange() | CJoinElement | |
getPrimaryKeySelect() | CJoinElement | |
getTableNameWithAlias() | CJoinElement | |
lazyFind() | Performs lazy find with the specified base record. | CJoinElement |
runQuery() | Executes the join query and populates the query results. | CJoinElement |
Property Details
list of child join elements
the unique ID of this tree node
the model associated with this tree node
the quoted table alias for this element
list of active records found by the queries. They are indexed by primary key values.
the relation represented by this tree node
list of stat elements
table alias for this join element
Method Details
public void __construct(CActiveFinder $finder, mixed $relation, CJoinElement $parent=NULL, integer $id=0)
| ||
$finder | CActiveFinder | the finder |
$relation | mixed | the relation (if the third parameter is not null) or the model (if the third parameter is null) associated with this tree node. |
$parent | CJoinElement | the parent tree node |
$id | integer | the ID of this tree node that is unique among all the tree nodes |
Constructor.
public void afterFind()
|
Calls CActiveRecord::afterFind of all the records.
public void beforeFind()
|
Calls CActiveRecord::beforeFind.
public void buildQuery(CJoinQuery $query)
| ||
$query | CJoinQuery | the query being built up |
Builds the join query with all descendant HAS_ONE and BELONGS_TO nodes.
public integer count(CDbCriteria $criteria=NULL)
| ||
$criteria | CDbCriteria | the query criteria |
{return} | integer | number of primary records. |
Count the number of primary records returned by the join statement.
public void find(CDbCriteria $criteria=NULL)
| ||
$criteria | CDbCriteria | the query criteria |
Performs the recursive finding with the criteria.
public void findWithBase(mixed $baseRecords)
| ||
$baseRecords | mixed | the available base record(s). |
Performs the eager loading with the base records ready.
public string getColumnPrefix()
| ||
{return} | string | the column prefix for column reference disambiguation |
public string getColumnSelect(mixed $select='*')
| ||
$select | mixed | columns to be selected. Defaults to '*', indicating all columns. |
{return} | string | the column selection |
Generates the list of columns to be selected. Columns will be properly aliased and primary keys will be added to selection if they are not specified.
public string getJoinCondition()
| ||
{return} | string | the join statement (this node joins with its parent) |
public string getPrimaryKeyRange()
| ||
{return} | string | the condition that specifies only the rows with the selected primary key values. |
public string getPrimaryKeySelect()
| ||
{return} | string | the primary key selection |
public string getTableNameWithAlias()
| ||
{return} | string | the table name and the table alias (if any). This can be used directly in SQL query without escaping. |
public void lazyFind(CActiveRecord $baseRecord)
| ||
$baseRecord | CActiveRecord | the active record whose related object is to be fetched. |
Performs lazy find with the specified base record.
public void runQuery(CJoinQuery $query)
| ||
$query | CJoinQuery | the query to be executed. |
Executes the join query and populates the query results.