public function defaultScope(){
$criteria = new CDbCriteria();
$criteria->with = array('ContentD');
$criteria->condition = "ContentD.lang = :lang";
$criteria->params = array(':lang' => Yii::app()->language );
return $criteria;
}
but there are error,
CDbException
Description
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ContentD.lang' in 'where clause'
and the "with" criteria is not work. becuase the query that resulted by the defaultScope() is
rror in querying SQL: SELECT COUNT(*) FROM `tsite_Content` `t` WHERE
(ContentD.lang = :lang) AND (parent_id = :parent_id)