Advertisement
Guest User

Untitled

a guest
Mar 26th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. $criteria=new CDbCriteria;
  2. $criteria->with = array(
  3. 'historicalUsageAvg'=>array
  4. (
  5. 'order'=>'historicalUsageAvg.EnrollmentCompleted DESC',
  6. 'limit'=>1,
  7. 'select'=>'(AVGUsage*12) AS HistoricalUsageAvg'
  8. )
  9. );
  10. $criteria->together = true;
  11.  
  12. It only produces this, which is the id of the relation table
  13. --
  14.  
  15. [historicalUsageAvg] => HistoricalUsage Object
  16. (
  17. [_new:CActiveRecord:private] =>
  18. [_attributes:CActiveRecord:private] => Array
  19. (
  20. [id] => 10340
  21. )
  22.  
  23. [_related:CActiveRecord:private] => Array
  24. (
  25. )
  26.  
  27. [_c:CActiveRecord:private] =>
  28. [_pk:CActiveRecord:private] => 10340
  29. [_alias:CActiveRecord:private] => t
  30. [_errors:CModel:private] => Array
  31. (
  32. )
  33.  
  34. [_validators:CModel:private] =>
  35. [_scenario:CModel:private] => update
  36. [_e:CComponent:private] =>
  37. [_m:CComponent:private] =>
  38. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement