protected function findModel($id) { if (is_array($id)) { $model = Post::find()->where(['id' => $id])->all(); } else { $model = Post::findOne($id); } if ($model !== null) { return $model; } else { throw new HttpException(404); } }