<?php

namespace App\Models;

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

class Stp extends DeviceRelatedModel implements Keyable
{
    use HasFactory;
    protected $table = 'stp';
    protected $primaryKey = 'stp_id';
    public $timestamps = false;
    protected $fillable = [
        'device_id',
        'vlan',
        'rootBridge',
        'bridgeAddress',
        'protocolSpecification',
        'priority',
        'timeSinceTopologyChange',
        'topChanges',
        'designatedRoot',
        'rootCost',
        'rootPort',
        'maxAge',
        'helloTime',
        'holdTime',
        'forwardDelay',
        'bridgeMaxAge',
        'bridgeHelloTime',
        'bridgeForwardDelay',
    ];

    public function getCompositeKey(): string
    {
        return (string) $this->vlan;
    }
}
