true, 'targetClass' => ProjectUser::className(), 'targetAttribute' => ['project_user_id' => 'id']], [['task_id'], 'exist', 'skipOnError' => true, 'targetClass' => Task::className(), 'targetAttribute' => ['task_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'task_id' => 'Task ID', 'project_user_id' => 'Project User ID', ]; } /** * @return \yii\db\ActiveQuery */ public function getProjectUser() { return $this->hasOne(ProjectUser::className(), ['id' => 'project_user_id']); } /** * @return \yii\db\ActiveQuery */ public function getTask() { return $this->hasOne(Task::className(), ['id' => 'task_id']); } }