Hello.
Model relations:
public function relations()
{
return array(
'lastReplyTime' => array(
self::STAT,'Post','topicId',
'select' => 'MAX(created)',
),
);
}
Model search:
public function search()
{
$criteria=new CDbCriteria;
$criteria->with = array('lastReplyTime');
return new CActiveDataProvider(__CLASS__, array(
'criteria'=>$criteria,
'sort' => array(
'defaultOrder' => 'lastReplyTime DESC',
),
));
}
Returns error.
Actually even if I remove the sorting stuff it doesn’t load lastReplyTime eagerly - it still creates a separate query for it. Is there any solution for this?
Thank you.