<?php

declare(strict_types=1);

namespace Seka\Vzdelavanie\Models\Pouzivatel\Testovanie;

use Illuminate\Database\Eloquent\Model;

/**
 * Class Otazka
 *
 * @package Seka\Vzdelavanie\Models\Pouzivatel\Testovanie
 */
class Otazka extends Model
{
    /**
     * @var string
     */
    protected $table = 'vzdelavanie_pouzivatel_testovanie_otazky';

    /**
     * @var string[]
     */
    protected $fillable = [
        'znenie',
        'druh',
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function test()
    {
        return $this->belongsTo(Test::class, 'pouzivatel_testovanie_test_id', 'id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function odpovede()
    {
        return $this->hasMany(Odpoved::class, 'pouzivatel_testovanie_otazka_id', 'id');
    }

    /**
     * @param string      $childType
     * @param mixed       $value
     * @param string|null $field
     *
     * @return \Illuminate\Database\Eloquent\Model|void|null
     */
    public function resolveChildRouteBinding($childType, $value, $field)
    {
        // TODO: Implement resolveChildRouteBinding() method.
    }
}
