I’m not sure if this error comes from PHP or Yii. What I’m doing is creating a class that extends CActiveRecord and add a static method:
class ActiveRecord extends CActiveRecord
{
private static $_listData;
public static function getListData($condition='', $params=array())
{
if (is_null(self::$_listData))
self::$_listData = CHtml::listData(self::model()->findAll($condition, $params), 'id', 'name');
return self::$_listData;
}
}
so I can create a model (eg. User model) that extends ActiveRecord class and call getListData method by
User::getListData()
(I’m intended to use it for Drop Down list in the view).
But I got this error:
What could be the problem?