I have viewed the documentation and found such description of $modelClass: “the model class (e.g. ‘Post’) or the model finder instance (e.g. Post::model(), Post::model()->published()).”
However, when I input my "OrderDetails" models it outputs an error message:" Fatal error: Call to a member function getDbCriteria() on a non-object"
Here is my code
public function actionViewDetail($o_id){
$order = Order::model()->findByPk($o_id);
$dataProviderSet=new CActiveDataProvider($order->orderDetails);
$this->render('indexDetail',array(
'dataProviderSet'=>$dataProviderSet,
));
}
orderDetails already defined in Order Class’s relations.
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(
'idMember' => array(self::BELONGS_TO, 'Member', 'id_member'),
'orderDetails' => array(self::HAS_MANY, 'OrderDetails', 'id_order'),
);
}