<?php

namespace App\Models;


use App\Classes\General\Interfaces\KeyValueInterface;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;

class VoucherCampaign extends AbstractModel implements KeyValueInterface
{
    protected $table = 'voucher_campaigns';

    /**
     * @return HasMany
     */
    public function vouchers()
    {
        return $this->hasMany(Voucher::class, 'voucher_campaign_id');
    }

    /**
     * @return MorphMany
     */
    public function attributesKVP(): MorphMany
    {
        return $this->morphMany(KeyValuePair::class, 'owner');
    }
}
