<?php

namespace App\Models;

use App\Classes\General\Interfaces\Documentable;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphMany;

/**
 * Class Contact
 * @package App\Models
 */
class QAUserAnswerSelected extends AbstractModel implements Documentable
{
	protected $table = 'qa_user_answer_selected';

    /**
     * @return MorphMany
     */
    public function documents(): morphMany
    {
        return $this->morphMany(Document::class, 'owner');
    }

    /**
     * @return BelongsTo
     */
    public function userSource(): BelongsTo
    {
        return $this->BelongsTo(QAUserSource::class, 'source_id', 'id');
    }

    /**
     * @return BelongsTo
     */
    public function user(): BelongsTo
    {
        return $this->BelongsTo(User::class, 'user_id', 'id');
    }

    /**
     * @return BelongsTo
     */
    public function question(): BelongsTo
    {
        return $this->BelongsTo(QAQuestions::class, 'question_id', 'id');
    }

}
