Class CActiveFinder
CActiveFinder implements eager loading and lazy loading of related active
records.
When used in eager loading, this class provides the same set of find methods
as CActiveRecord
.
-
CComponent
-
CActiveFinder
Methods summary
public
|
#
__construct( CActiveRecord $model, mixed $with )
Constructor. A join tree is built up based on the declared relationships
between active record classes.
Constructor. A join tree is built up based on the declared relationships
between active record classes.
Parameters
- $model
CActiveRecord
$model the model that initiates the active finding process
- $with
mixed $with the relation names to be actively looked for
|
public
mixed
|
#
query( CDbCriteria $criteria, boolean $all = false )
Do not call this method. This method is used internally to perform the
relational query based on the given DB criteria.
Do not call this method. This method is used internally to perform the
relational query based on the given DB criteria.
Parameters
- $criteria
CDbCriteria
$criteria the DB criteria
- $all
boolean $all whether to bring back all records
Returns
mixed the query result
|
public
CActiveRecord
|
#
findBySql( string $sql, array $params = array() )
This method is internally called.
This method is internally called.
Parameters
- $sql
string $sql the SQL statement
- $params
array $params parameters to be bound to the SQL statement
Returns
|
public
CActiveRecord[]
|
#
findAllBySql( string $sql, array $params = array() )
This method is internally called.
This method is internally called.
Parameters
- $sql
string $sql the SQL statement
- $params
array $params parameters to be bound to the SQL statement
Returns
|
public
string
|
#
count( CDbCriteria $criteria )
This method is internally called.
This method is internally called.
Parameters
Returns
string
|
public
|
#
lazyFind( CActiveRecord $baseRecord )
Finds the related objects for the specified active record. This method is
internally invoked by CActiveRecord to support lazy loading.
Finds the related objects for the specified active record. This method is
internally invoked by CActiveRecord to support lazy loading.
Parameters
- $baseRecord
CActiveRecord
$baseRecord the base record whose related objects are to be loaded
|
public
CActiveRecord
|
#
getModel( string $className )
Given active record class name returns new model instance.
Given active record class name returns new model instance.
Parameters
- $className
string $className active record class name
Returns
Since
1.1.14
|
Methods inherited from CComponent
__call(),
__get(),
__isset(),
__set(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|
Properties summary
public
boolean
|
$joinAll
|
false |
#
join all tables all at once. Defaults to false. This property is internally
used.
join all tables all at once. Defaults to false. This property is internally
used.
|
public
boolean
|
$baseLimited
|
false |
#
whether the base model has limit or offset. This property is internally
used.
whether the base model has limit or offset. This property is internally
used.
|