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