Cdbcriteria Problem - Doesn't Know The Condition Method


I implemented this code:

$criteria = new CDbCriteria();



		$dataProvider=new CActiveDataProvider('Result', array( 'criteria'=>$criteria,));

But the Yii always give me error messages:


CDbCriteria and its behaviors do not have a method or closure named "condition".


But I don’t know why I get this error message, I searched on stackoverflow, the documentation, and my code looks good…

I don’t have idea what is the problem.

Like the error message tells you: order and condition are not methods.

They are properties. So:

$criteria->condition = 'turn='.$turn->attributes['current_turn'];

$criteria->order = 'value';

you can try…


$criteria->order = 'value';