<?php

declare(strict_types=1);

namespace Seka\Vzdelavanie\Models\Pouzivatel\Testovanie;

use Illuminate\Database\Eloquent\Model;

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

    /**
     * @var string[]
     */
    protected $fillable = [
        'nazov_kategorie',
        'nazov',
        'popis',
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function pouzivatel()
    {
        return $this->belongsTo('\App\Models\Pouzivatel\Pouzivatel', 'pouzivatel_id', 'id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function otazky()
    {
        return $this->hasMany(Otazka::class, 'pouzivatel_testovanie_test_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.
    }
}
