255], [['main_stack'], 'exist', 'skipOnError' => true, 'targetClass' => Skill::className(), 'targetAttribute' => ['main_stack' => 'id']], [['card_id'], 'exist', 'skipOnError' => true, 'targetClass' => UserCard::className(), 'targetAttribute' => ['card_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'card_id' => 'Card ID', 'title' => 'Название', 'description' => 'Описание', 'main_stack' => 'Основная технология', 'additional_stack' => 'Используемые технологии', 'link' => 'Ссылка', ]; } /** * @return \yii\db\ActiveQuery */ public function getMainStack() { return $this->hasOne(Skill::className(), ['id' => 'main_stack']); } /** * @return \yii\db\ActiveQuery */ public function getCard() { return $this->hasOne(UserCard::className(), ['id' => 'card_id']); } public function getSkill() { return $this->hasOne(Skill::className(), ['id' => 'main_stack']); } }