<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use LibreNMS\Interfaces\Models\Keyable;

class EntPhysical extends DeviceRelatedModel implements Keyable
{
    use HasFactory;

    protected $table = 'entPhysical';
    protected $primaryKey = 'entPhysical_id';
    public $timestamps = false;
    protected $fillable = [
        'entPhysicalIndex',
        'entPhysicalDescr',
        'entPhysicalContainedIn',
        'entPhysicalClass',
        'entPhysicalName',
        'entPhysicalSerialNum',
        'entPhysicalModelName',
        'entPhysicalMfgName',
        'entPhysicalMfgDate',
        'entPhysicalVendorType',
        'entPhysicalParentRelPos',
        'entPhysicalHardwareRev',
        'entPhysicalFirmwareRev',
        'entPhysicalSoftwareRev',
        'entPhysicalIsFRU',
        'entPhysicalAlias',
        'entPhysicalAssetID',
        'ifIndex',
    ];

    public function getCompositeKey(): int
    {
        return (int) $this->entPhysicalIndex;
    }
}
