Hi guy,
I have the following code:
$criteria = new CDbCriteria;
$criteria->condition = 'ratingAdjustment = 1 AND sortOrder IS NOT NULL';
$criteria->order = 'sortOrder ASC';
$things_you_want = DC::model()->findAll($criteria);
Is there another way to do this so that I can put the logic in DC model and I call DC::model()->getThingsYouWant() for example.
In DC model file, I have
public static function thingsYouWant()
{
$criteria = new CDbCriteria;
$criteria->condition = 'ratingAdjustment = 1 AND sortOrder IS NOT NULL';
$criteria->order = 'sortOrder ASC';
return $this->findAll($criteria);
}
and I call DC::thingsYouWant() which return
Fatal error: Using $this when not in object context in C:\Ampps\www\MPP\protected\models\DC.php on line 94
I am missing something here and I have no clues.
Thanks for helps,