replace 'deleteAll' for 'foreach'

Because deleteAll not triggers events
https://github.com/yiisoft/yii2/issues/1404
Merge pull request #2 from makeen/master

replace `deleteAll()` with `foreach(){delete()}`