I suppose this code should help you. Yes: you can add a method to a module that get another table instance
class MyModelTwo {
public $tableTwoAttribute;
}
class MyModelOne {
public function getOtherTable()
{
return MyModelTwo::model()->findByPk($this->model_two_id);
}
}
And use this "getter" to load ather tables attributes.
I have done this in past I dont know if this fit your needs
class Model extends CActiveRecord {
public $propteryFromSecondModel;
}
$criteria = new CDbCriteria;
$criteria->select= "`t`.`*`, (SELECT `t2`.`fieldname` FROM `table2` `t2` WHERE YOURCONDITION) as `propertyFromSecondModel`";
....
basically declare a public property/attribute in your model and Yii will take of the rest.