Есть моделька со своим scopes, через которую я получаю определенные записи
class MainTsee extends CActiveRecord
{
public function tableName()
{
return '{{main_tsee}}';
}
public function scopes() {
return array(
'pupular'=>array (
'order'=>'look_count'
),
);
}
Эта моделька связана с другой вот так
class Country extends CActiveRecord
{
public function tableName()
{
return '{{country}}';
}
public function rules()
{ //.. some rules }
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array( 'see_places'=>array(self::HAS_MANY, 'MainTsee', 'id_country'),
Вопрос как мне получать значения заданные в scopes через связи?
Обычно без связей так получаю MainTsee::model()->popular->findAll();
А как сделать такую выборку используя связи $model->see_places->popular - например