<?php

declare(strict_types=1);

namespace Seka\Portal\Modul\Vzdelavanie\Models\Popularita;

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

/**
 * Class Popularita
 *
 * @package Seka\Portal\Modul\Vzdelavanie\Models\Popularita
 */
final class Popularita extends Model
{
    /**
     * @var string
     */
    protected $table = 'vzdelavanie_popularnost';

    /**
     * @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 popularita(): MorphTo
    {
        return $this->morphTo();
    }
}
