CJoinElement
包 | system.db.ar |
---|---|
继承 | class CJoinElement |
可用自 | 1.0 |
版本 | $Id$ |
公共属性
属性 | 类型 | 描述 | 被定义在 |
---|---|---|---|
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 |
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 |
公共方法
方法 | 描述 | 被定义在 |
---|---|---|
__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 |
getCondition() | CJoinElement | |
getGroupBy() | CJoinElement | |
getHaving() | CJoinElement | |
getJoinCondition() | CJoinElement | |
getOrder() | 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 |
属性详情
list of child join elements
the unique ID of this tree node
the model associated with this tree node
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
方法详情
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 getCondition()
| ||
{return} | string | the WHERE clause. Column references are properly disambiguated. |
public string getGroupBy()
| ||
{return} | string | the GROUP BY clause. Column references are properly disambiguated. |
public string getHaving()
| ||
{return} | string | the HAVING clause. Column references are properly disambiguated. |
public string getJoinCondition()
| ||
{return} | string | the join statement (this node joins with its parent) |
public string getOrder()
| ||
{return} | string | the ORDER BY clause. Column references are properly disambiguated. |
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.