Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $criteria=new CDbCriteria;
- $criteria->with = array(
- 'historicalUsageAvg'=>array
- (
- 'order'=>'historicalUsageAvg.EnrollmentCompleted DESC',
- 'limit'=>1,
- 'select'=>'(AVGUsage*12) AS HistoricalUsageAvg'
- )
- );
- $criteria->together = true;
- It only produces this, which is the id of the relation table
- --
- [historicalUsageAvg] => HistoricalUsage Object
- (
- [_new:CActiveRecord:private] =>
- [_attributes:CActiveRecord:private] => Array
- (
- [id] => 10340
- )
- [_related:CActiveRecord:private] => Array
- (
- )
- [_c:CActiveRecord:private] =>
- [_pk:CActiveRecord:private] => 10340
- [_alias:CActiveRecord:private] => t
- [_errors:CModel:private] => Array
- (
- )
- [_validators:CModel:private] =>
- [_scenario:CModel:private] => update
- [_e:CComponent:private] =>
- [_m:CComponent:private] =>
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement