It ain’t funny man. To delete row from Yii I would have to click on CButtonColumn of cGridView and the confirm alert. No way I did that. Deleting row from database by myself? Why?
Well yesterday at the afternoon the same thing happened, anyway I thought "maybe not…" but I knew it was there and then gone.
None. I checked DB sql from PhpMysqlAdmin export, and Yii’s models code. Well I would remember… That’s sick - I added missing rows with missing IDs, now after few hours ID 1000001 is gone. What the heck? I’ll check awstats on my ISP site, mysql logs are beyond my eyes…
Hm, you could add a beforeDelete method for the model which will explicitly call Yii::log() and log the deletion of the item. If your problem is from within Yii, you’ll at least have a record of it.
public void log(string $message, string $level='info', string $category='application')
So, in the model, something like:
protected function beforeDelete()
{
Yii::log('Yii is deleting this model: '.$this->id, 'warning', 'application.models');
return parent::beforeDelete();
}
Rather than testing it from the admin view, I would recommend testing it from the ‘view’ first, if you have one set up – less external variables to worry about.