/** * Finds the DeliveryMethodTranslation model based on delivery method id and language id. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @param integer $languageId * @return mixed * @throws NotFoundHttpException if the model cannot be found */ protected function findModelTranslation($id, $languageId) { $model = ProductAvailabilityTranslation::find()->where(['availability_id' => $id, 'language_id' => $languageId])->one(); if ($model !== null) { return $model; } else { return false; } }
/** * @return \yii\db\ActiveQuery */ public function getTranslations() { return $this->hasMany(ProductAvailabilityTranslation::className(), ['availability_id' => 'id']); }