true, 'targetClass' => Project::className(), 'targetAttribute' => ['project_id' => 'id']], [['card_id'], 'exist', 'skipOnError' => true, 'targetClass' => UserCard::className(), 'targetAttribute' => ['card_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'card_id' => 'Card ID', 'project_id' => 'Project ID', ]; } /** * @return \yii\db\ActiveQuery */ public function getProject() { return $this->hasOne(Project::className(), ['id' => 'project_id']); } /** * @return \yii\db\ActiveQuery */ public function getCard() { return $this->hasOne(UserCard::className(), ['id' => 'card_id']); } }