<?php

declare(strict_types=1);

namespace Seka\Vzdelavanie\Models\Kurzy;

use Illuminate\Database\Eloquent\Model;
use Seka\Vzdelavanie\Enums\ModelsTypeEnum;
use Seka\Vzdelavanie\Models\Popularita\Popularita;
use Illuminate\Database\Eloquent\Relations\MorphMany;

/**
 * Class Kurz
 *
 * @package Seka\Vzdelavanie\Models\Kurzy
 */
final class Kurz extends Model
{
    /**
     * @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.
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
     */
    public function popularita(): MorphMany
    {
        return $this->morphMany(Popularita::class, 'popularita');
    }

    /**
     * @return string
     */
    public static function type(): string
    {
        return ModelsTypeEnum::MODEL_TYPE_KURZY_KURZ()->value;
    }
}
