/** * @param $id * @return null|static * @throws NotFoundHttpException */ protected function findModel($id) { if (($model = WordsCategory::findOne($id)) != null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }