Ejemplo n.º 1
0
 /**
  * Finds the DctAgeLoc model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return DctAgeLoc the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = DctAgeLoc::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Ejemplo n.º 2
0
 public function saveLocalizationData($model, $params, $languageCount)
 {
     for ($i = 0; $i < $languageCount; $i++) {
         if ($model->dct_age_id > -1) {
             $childModel = new DctAgeLoc();
             $childModel->dct_age_id = $model->dct_age_id;
             $childModel->dct_language_id = $params[$i]['dct_language_id'];
         } else {
             $childModel = DctAgeLoc::findOne($params[$i]['dct_age_loc_id']);
         }
         $childModel->text = !empty($params[$i]['text']) ? $params[$i]['text'] : '';
         $childModel->save();
     }
 }