true, 'targetClass' => Portfolio::className(), 'targetAttribute' => ['portfolio_id' => 'portfolio_id']], [['specialization_id'], 'exist', 'skipOnError' => true, 'targetClass' => Specialization::className(), 'targetAttribute' => ['specialization_id' => 'specialization_id']], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'portfolio_specialization_id' => Yii::t('app', 'Portfolio Specialization ID'), 'portfolio_id' => Yii::t('app', 'Portfolio ID'), 'specialization_id' => Yii::t('app', 'Specialization ID'), ]; } /** * @return \yii\db\ActiveQuery */ public function getPortfolio() { return $this->hasOne(Portfolio::className(), ['portfolio_id' => 'portfolio_id']); } /** * @return \yii\db\ActiveQuery */ public function getSpecialization() { return $this->hasOne(Specialization::className(), ['specialization_id' => 'specialization_id']); } }