Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • ActionToRecord
  • CActiveFinder
  • CActiveRecord
  • CActiveRecordBehavior
  • CActiveRecordMetaData
  • CActiveRelation
  • CBaseActiveRelation
  • CBelongsToRelation
  • CHasManyRelation
  • CHasOneRelation
  • CJoinElement
  • CJoinQuery
  • CManyManyRelation
  • ContactsNameBehavior
  • CStatElement
  • CStatRelation
  • ERememberFiltersBehavior
  • FileSystemObjectBehavior
  • MobileLayouts
  • RecordAliases
  • RelationshipsBehavior
  • TopicReplies
  • X2ActiveRecord
  • X2Flow
  • Overview
  • Package
  • Class
  • Tree

Class CJoinElement

CJoinElement represents a tree node in the join tree created by CActiveFinder.

Package: system\db\ar
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/db/ar/CActiveFinder.php
Methods summary
public
# __construct( CActiveFinder $finder, mixed $relation, CJoinElement $parent = null, integer $id = 0 )

Constructor.

Constructor.

Parameters

$finder
CActiveFinder
$finder the finder
$relation
mixed
$relation 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
$parent the parent tree node
$id
integer
$id the ID of this tree node that is unique among all the tree nodes
public
# destroy( )

Removes references to child elements and finder to avoid circular references. This is internally used.

Removes references to child elements and finder to avoid circular references. This is internally used.

public
# find( CDbCriteria $criteria = null )

Performs the recursive finding with the criteria.

Performs the recursive finding with the criteria.

Parameters

$criteria
CDbCriteria
$criteria the query criteria
public
# lazyFind( CActiveRecord $baseRecord )

Performs lazy find with the specified base record.

Performs lazy find with the specified base record.

Parameters

$baseRecord
CActiveRecord
$baseRecord the active record whose related object is to be fetched.
public
# findWithBase( mixed $baseRecords )

Performs the eager loading with the base records ready.

Performs the eager loading with the base records ready.

Parameters

$baseRecords
mixed
$baseRecords the available base record(s).
public string
# count( CDbCriteria $criteria = null )

Count the number of primary records returned by the join statement.

Count the number of primary records returned by the join statement.

Parameters

$criteria
CDbCriteria
$criteria the query criteria

Returns

string
number of primary records. Note: type is string to keep max. precision.
public
# afterFind( )

Calls CActiveRecord::afterFind() of all the records.

Calls CActiveRecord::afterFind() of all the records.

public
# buildQuery( CJoinQuery $query )

Builds the join query with all descendant HAS_ONE and BELONGS_TO nodes.

Builds the join query with all descendant HAS_ONE and BELONGS_TO nodes.

Parameters

$query
CJoinQuery
$query the query being built up
public
# runQuery( CJoinQuery $query )

Executes the join query and populates the query results.

Executes the join query and populates the query results.

Parameters

$query
CJoinQuery
$query the query to be executed.
public string
# getTableNameWithAlias( )

Returns

string
the table name and the table alias (if any). This can be used directly in SQL query without escaping.
public string
# getColumnSelect( mixed $select = '*' )

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.

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.

Parameters

$select
mixed
$select columns to be selected. Defaults to '*', indicating all columns.

Returns

string
the column selection

Throws

CDbException
if active record class is trying to select an invalid column
public string
# getPrimaryKeySelect( )

Returns

string
the primary key selection
public string
# getPrimaryKeyRange( )

Returns

string
the condition that specifies only the rows with the selected primary key values.
public string
# getColumnPrefix( )

Returns

string
the column prefix for column reference disambiguation
public string
# getJoinCondition( )

Returns

string
the join statement (this node joins with its parent)

Throws

CDbException
if relation in active record class is not specified correctly
Properties summary
public integer $id
#

the unique ID of this tree node

the unique ID of this tree node

public CActiveRelation $relation
#

the relation represented by this tree node

the relation represented by this tree node

public CActiveRelation $master
#

the master relation

the master relation

public CActiveRelation $slave
#

the slave relation

the slave relation

public CActiveRecord $model
#

the model associated with this tree node

the model associated with this tree node

public array $records array()
#

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

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

public array $children array()
#

list of child join elements

list of child join elements

public array $stats array()
#

list of stat elements

list of stat elements

public string $tableAlias
#

table alias for this join element

table alias for this join element

public string $rawTableAlias
#

the quoted table alias for this element

the quoted table alias for this element

API documentation generated by ApiGen 2.8.0