/**
  * Finds the Language model based on its code value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  *
  * @param string $code
  *
  * @return Language the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findLanguage($code)
 {
     $language = Language::findOne($code);
     if ($language === null) {
         throw new \yii\web\NotFoundHttpException('The requested language does not exist');
     }
     return $language;
 }