I have a field in my database that is a string. That string is not always a utf8 string. Eventually I need to encode this string. Right now I am just trying to replace the string with the following string "dd". How do I change this string in my model file.
Code:
class Post extends CActiveRecord
{
...
public function search()
{
$criteria = new CDbCriteria;
...
$criteria->compare('title',$this->title);
...
$CADP = new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
//The following does not work
$CADP->setData(array("title"=>"dd"));
//The following does not work either
$CADP->__set("title","dd");
return $CADP;
}
}