/** * @param bool $id * @throws NotFoundHttpException * @return AuthItemChild */ protected function findModel($id = false) { if (!$id) { $model = new AuthItemChild(); } else { if (!($model = AuthItemChild::findOne($id))) { throw new NotFoundHttpException('Model not found.'); } } return $model; }