dckurushin
(Diavolonok)
1
this works:
Invoice::model()->deleteAll('userID = ? AND isPaid = ?' , array(Yii::app()->user->id, false));
this not (deletes everything):
Invoice::model()->userID(Yii::app()->user->id)->isPaid(false)->deleteAll();
why?
cant use scopes with delete all ?
dudhi
(Rohitduhan)
2
right, can’t use scopes with delete all.
This link will help, check out the comment by Woil. He also mentions a workaround it.
http://www.yiiframework.com/doc/guide/1.1/en/database.ar#named-scopes