CActiveFinder
| Package |
system.db.ar |
| Inheritance |
class CActiveFinder »
CComponent |
| Since |
1.0 |
| Version |
$Id: CActiveFinder.php 2231 2010-06-25 21:05:21Z qiang.xue $ |
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.
Property Details
public boolean $baseLimited;
whether the base model has limit or offset.
This property is internally used.
public boolean $joinAll;
join all tables all at once. Defaults to false.
This property is internally used.
Method Details
|
|
| $model |
CActiveRecord |
the model that initiates the active finding process |
| $with |
mixed |
the relation names to be actively looked for |
Constructor.
A join tree is built up based on the declared relationships between active record classes.
|
public void count($condition='', $params=array (
))
|
| $condition |
|
|
| $params |
|
|
This is the relational version of CActiveRecord::count().
|
public void find($condition='', $params=array (
))
|
| $condition |
|
|
| $params |
|
|
This is the relational version of CActiveRecord::find().
|
public void findAll($condition='', $params=array (
))
|
| $condition |
|
|
| $params |
|
|
This is the relational version of CActiveRecord::findAll().
|
public void findAllByAttributes($attributes, $condition='', $params=array (
))
|
| $attributes |
|
|
| $condition |
|
|
| $params |
|
|
This is the relational version of CActiveRecord::findAllByAttributes().
|
public void findAllByPk($pk, $condition='', $params=array (
))
|
| $pk |
|
|
| $condition |
|
|
| $params |
|
|
This is the relational version of CActiveRecord::findAllByPk().
|
public void findAllBySql($sql, $params=array (
))
|
| $sql |
|
|
| $params |
|
|
This is the relational version of CActiveRecord::findAllBySql().
|
public void findByAttributes($attributes, $condition='', $params=array (
))
|
| $attributes |
|
|
| $condition |
|
|
| $params |
|
|
This is the relational version of CActiveRecord::findByAttributes().
|
public void findByPk($pk, $condition='', $params=array (
))
|
| $pk |
|
|
| $condition |
|
|
| $params |
|
|
This is the relational version of CActiveRecord::findByPk().
|
public void findBySql($sql, $params=array (
))
|
| $sql |
|
|
| $params |
|
|
This is the relational version of CActiveRecord::findBySql().
|
|
| $baseRecord |
CActiveRecord |
the base record whose related objects are to be loaded |
Finds the related objects for the specified active record.
This method is internally invoked by CActiveRecord to support lazy loading.
public mixed query( CDbCriteria $criteria, boolean $all=false)
|
| $criteria |
CDbCriteria |
the DB criteria |
| $all |
boolean |
whether to bring back all records |
| {return} |
mixed |
the query result |
Performs the relational query based on the given DB criteria.
Do not call this method. This method is used internally.
|
public CActiveFinder together()
|
| {return} |
CActiveFinder |
the finder object |
Uses the most aggressive join approach.
By calling this method, even if there is LIMIT/OFFSET option set for
the primary table query, we will still use a single SQL statement.
By default (without calling this method), the primary table will be queried
by itself so that LIMIT/OFFSET can be correctly applied.