<?php

declare(strict_types=1);

namespace Seka\Vzdelavanie\Models\Popularita;

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

/**
 * Class Popularita
 *
 * @package Seka\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();
    }
}
