<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Kriteria extends Model
{
    use HasFactory;
    protected $fillable = ['nama', 'satuan'];

    public function pairwise1()
    {
        return $this->hasMany(PerbandinganKriteria::class, 'kriteria_id_1');
    }

    public function pairwise2()
    {
        return $this->hasMany(PerbandinganKriteria::class, 'kriteria_id_2');
    }

    public function bobot()
    {
        return $this->hasOne(BobotKriteria::class);
    }

    public function skorMakanan()
    {
        return $this->hasMany(SkorMakanan::class);
    }
}
