system system.base system.caching system.caching.dependencies system.collections system.console system.db system.db.ar system.db.schema system.db.schema.mssql system.db.schema.mysql system.db.schema.oci system.db.schema.pgsql system.db.schema.sqlite system.i18n system.i18n.gettext system.logging system.utils system.validators system.web system.web.actions system.web.auth system.web.filters system.web.helpers system.web.renderers system.web.services system.web.widgets system.web.widgets.captcha system.web.widgets.pagers

CJoinElement

system.db.ar
继承 class CJoinElement
可用自 1.0
版本 $Id$
CJoinElement represents a tree node in the join tree created by CActiveFinder.

公共属性

隐藏继承的属性

属性类型描述被定义在
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

属性详情

children 属性
public array $children;

list of child join elements

id 属性
public integer $id;

the unique ID of this tree node

model 属性
public CActiveRecord $model;

the model associated with this tree node

records 属性
public array $records;

list of active records found by the queries. They are indexed by primary key values.

relation 属性
public CActiveRelation $relation;

the relation represented by this tree node

stats 属性 (自版本 v1.0.4 可用)
public array $stats;

list of stat elements

tableAlias 属性
public string $tableAlias;

table alias for this join element

方法详情

__construct() 方法
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.

afterFind() 方法 (自版本 v1.0.3 可用)
public void afterFind()

Calls CActiveRecord::afterFind of all the records.

beforeFind() 方法 (自版本 v1.0.11 可用)
public void beforeFind()

Calls CActiveRecord::beforeFind.

buildQuery() 方法
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.

count() 方法 (自版本 v1.0.3 可用)
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.

find() 方法
public void find(CDbCriteria $criteria=NULL)
$criteria CDbCriteria the query criteria

Performs the recursive finding with the criteria.

findWithBase() 方法
public void findWithBase(mixed $baseRecords)
$baseRecords mixed the available base record(s).

Performs the eager loading with the base records ready.

getColumnPrefix() 方法
public string getColumnPrefix()
{return} string the column prefix for column reference disambiguation

getColumnSelect() 方法
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.

getCondition() 方法
public string getCondition()
{return} string the WHERE clause. Column references are properly disambiguated.

getGroupBy() 方法 (自版本 v1.0.4 可用)
public string getGroupBy()
{return} string the GROUP BY clause. Column references are properly disambiguated.

getHaving() 方法 (自版本 v1.0.4 可用)
public string getHaving()
{return} string the HAVING clause. Column references are properly disambiguated.

getJoinCondition() 方法
public string getJoinCondition()
{return} string the join statement (this node joins with its parent)

getOrder() 方法
public string getOrder()
{return} string the ORDER BY clause. Column references are properly disambiguated.

getPrimaryKeyRange() 方法
public string getPrimaryKeyRange()
{return} string the condition that specifies only the rows with the selected primary key values.

getPrimaryKeySelect() 方法
public string getPrimaryKeySelect()
{return} string the primary key selection

getTableNameWithAlias() 方法
public string getTableNameWithAlias()
{return} string the table name and the table alias (if any). This can be used directly in SQL query without escaping.

lazyFind() 方法
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.

runQuery() 方法
public void runQuery(CJoinQuery $query)
$query CJoinQuery the query to be executed.

Executes the join query and populates the query results.