Versions
Look up a class, method, property or event

CJoinElement

Package system.db.ar
Inheritance class CJoinElement
Since 1.0
Version $Id: CActiveFinder.php 1592 2009-12-15 16:06:00Z qiang.xue $
CJoinElement represents a tree node in the join tree created by CActiveFinder.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined 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
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

Hide inherited methods

MethodDescriptionDefined 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
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

Property Details

children property
public array $children;

list of child join elements

id property
public integer $id;

the unique ID of this tree node

model property
public CActiveRecord $model;

the model associated with this tree node

records property
public array $records;

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

relation property
public CActiveRelation $relation;

the relation represented by this tree node

stats property (available since v1.0.4)
public array $stats;

list of stat elements

tableAlias property
public string $tableAlias;

table alias for this join element

Method Details

__construct() method
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() method (available since v1.0.3)
public void afterFind()

Calls CActiveRecord::afterFind of all the records.

beforeFind() method (available since v1.0.11)
public void beforeFind()

Calls CActiveRecord::beforeFind.

buildQuery() method
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() method (available since 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() method
public void find(CDbCriteria $criteria=NULL)
$criteria CDbCriteria the query criteria

Performs the recursive finding with the criteria.

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

Performs the eager loading with the base records ready.

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

getColumnSelect() method
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() method
public string getCondition()
{return} string the WHERE clause. Column references are properly disambiguated.

getGroupBy() method (available since v1.0.4)
public string getGroupBy()
{return} string the GROUP BY clause. Column references are properly disambiguated.

getHaving() method (available since v1.0.4)
public string getHaving()
{return} string the HAVING clause. Column references are properly disambiguated.

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

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

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

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

getTableNameWithAlias() method
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() method
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() method
public void runQuery(CJoinQuery $query)
$query CJoinQuery the query to be executed.

Executes the join query and populates the query results.

Be the first person to leave a comment

Please to leave your comment.