255], [['project_id', 'language_id'], 'unique', 'targetAttribute' => ['project_id', 'language_id'], 'message' => 'The combination of Project ID and Language ID has already been taken.'], [['language_id'], 'exist', 'skipOnError' => true, 'targetClass' => Language::className(), 'targetAttribute' => ['language_id' => 'language_id']], [['project_id'], 'exist', 'skipOnError' => true, 'targetClass' => Project::className(), 'targetAttribute' => ['project_id' => 'project_id']], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'project_id' => Yii::t('app', 'Project ID'), 'language_id' => Yii::t('app', 'Language ID'), 'title' => Yii::t('app', 'Title'), 'description' => Yii::t('app', 'Description'), ]; } /** * @return \yii\db\ActiveQuery */ public function getLanguage() { return $this->hasOne(Language::className(), ['language_id' => 'language_id']); } /** * @return \yii\db\ActiveQuery */ public function getProject() { return $this->hasOne(Project::className(), ['project_id' => 'project_id']); } }