When a behavior is fully qualified when it is attached to a CActiveRecord like this:
public ExampleModel extends CActiveRecord {
public function behaviors() {
return array(
'ERememberFiltersBehavior' => array(
'class' => 'ext.ERememberFiltersBehavior.ERememberFiltersBehavior',
'defaults'=>array(),
'defaultStickOnClear'=>false,
));
}
And the same model is retrieved from cache like this:
$result=Yii::app()->cache->get($key);
Where $key corresponds to a key saved earlier like this:
Yii::app()->cache->set($key,$examplemodel,300)
Then one gets the following error:
include(ERememberFiltersBehavior.php): failed to open stream: No such file or directory
The workaround is to add ERememberFiltersBehavior to the regular search path in the configuration (config.php) like this:
return array(
[...]
/* autoloading model and component classes */
'import'=>array(
'ext.ERememberFiltersBehavior.*',
),