carono /
yii2-crud
| 1 | <?php |
||
| 2 | |||
| 3 | |||
| 4 | namespace carono\yii2crud\actions; |
||
| 5 | |||
| 6 | use carono\yii2crud\CrudController; |
||
| 7 | use Yii; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Class DeleteBatch |
||
| 11 | * |
||
| 12 | * @package carono\yii2crud\actions |
||
| 13 | * @property CrudController $controller |
||
| 14 | */ |
||
| 15 | class DeleteBatch extends Action |
||
| 16 | { |
||
| 17 | public function run(array $ids) |
||
| 18 | { |
||
| 19 | $errors = []; |
||
| 20 | foreach ($ids as $id) { |
||
| 21 | $this->controller->runAction('delete', ['id' => $id]); |
||
| 22 | if (Yii::$app->session->hasFlash('error')) { |
||
|
0 ignored issues
–
show
|
|||
| 23 | $errors[] = Yii::$app->session->getFlash('error', null, true); |
||
| 24 | } |
||
| 25 | } |
||
| 26 | if (!empty($errors)) { |
||
| 27 | Yii::$app->session->removeFlash('success'); |
||
| 28 | Yii::$app->session->setFlash('error', implode('<br>', $errors)); |
||
| 29 | } |
||
| 30 | if (Yii::$app->request->isAjax) { |
||
| 31 | return Yii::$app->response->redirect(Yii::$app->request->referrer, 302, false); |
||
| 32 | } |
||
| 33 | |||
| 34 | return $this->controller->redirect($this->controller->deleteBatchRedirect()); |
||
| 35 | } |
||
| 36 | } |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.