<?php

declare(strict_types=1);

namespace Seka\Vzdelavanie\Models\Pouzivatel\Kniznica;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
 * Class Oblubene
 *
 * @package Seka\Vzdelavanie\Models\Pouzivatel\Kniznica
 */
final class Oblubene extends Model
{
    /**
     * @var string
     */
    protected $table = 'vzdelavanie_pouzivatel_kniznica_oblubene';

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

    /**
     * @return \Illuminate\Database\Eloquent\Relations\MorphTo
     */
    public function oblubene(): MorphTo
    {
        return $this->morphTo();
    }
}
