<?php

namespace App\Entities\Equipment;

use App\Models\Equipment\ServerModel;

class ServerEntity extends EquipmentEntity
{
    const PK    = ServerModel::PK;
    const TITLE = ServerModel::TITLE;
    const DEFAULT_STATUS    = STATUS['AVAILABLE'];
    final public function  getClientInfoUID(): int|null
    {
        return $this->attributes['clientinfo_uid'] ?? null;
    }
    final public function  getServiceInfoUID(): int|null
    {
        return $this->attributes['serviceinfo_uid'] ?? null;
    }
    //기본기능용
    public function getCustomTitle(mixed $title = null): string
    {
        return sprintf("[%s]%s", $this->getCode(), $title ? $title : $this->getIP());
    }
    final public function getCode(): string
    {
        return $this->attributes['code'];
    }
    public function getPrice(): int
    {
        return $this->attributes['price'];
    }
    public function getType(): string
    {
        return $this->attributes['type'];
    }
    public function getSwitch(): string|null
    {
        return $this->attributes['switch'] ?? null;
    }
    public function getIP(): string|null
    {
        return $this->attributes['ip'] ?? null;
    }
    public function getOS(): string|null
    {
        return $this->attributes['os'] ?? null;
    }
}
