76 lines
1.9 KiB
PHP
76 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Entities\Equipment;
|
|
|
|
use App\Models\Equipment\ServerModel;
|
|
|
|
class ServerEntity extends EquipmentEntity
|
|
{
|
|
const PK = ServerModel::PK;
|
|
const TITLE = ServerModel::TITLE;
|
|
protected $attributes = [
|
|
'code' => '',
|
|
'title' => '',
|
|
'type' => '',
|
|
'ip' => '',
|
|
'os' => '',
|
|
'price' => 0,
|
|
'manufactur_at' => '',
|
|
'format_at' => '',
|
|
'status' => STATUS['AVAILABLE'],
|
|
];
|
|
public function __construct(array|null $data = null)
|
|
{
|
|
parent::__construct($data);
|
|
}
|
|
final public function getClientInfoUid(): int|null
|
|
{
|
|
return $this->attributes['clientinfo_uid'] ?? null;
|
|
}
|
|
final public function getServiceInfoUid(): int|null
|
|
{
|
|
return $this->attributes['serviceinfo_uid'] ?? null;
|
|
}
|
|
final public function getChassisInfoUid(): int|null
|
|
{
|
|
return $this->attributes['chassisinfo_uid'] ?? null;
|
|
}
|
|
final public function getSwitchInfoUid(): int|null
|
|
{
|
|
return $this->attributes['switchinfo_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 getType(): string
|
|
{
|
|
return $this->attributes['type'] ?? '';
|
|
}
|
|
public function getIP(): string
|
|
{
|
|
return $this->attributes['ip'] ?? '';
|
|
}
|
|
public function getOS(): string
|
|
{
|
|
return $this->attributes['os'] ?? '';
|
|
}
|
|
public function getPrice(): int
|
|
{
|
|
return $this->attributes['price'] ?? 0;
|
|
}
|
|
public function getManufacturAt(): string
|
|
{
|
|
return $this->attributes['manufactur_at'] ?? '';
|
|
}
|
|
public function getFormatAt(): string
|
|
{
|
|
return $this->attributes['format_at'] ?? '';
|
|
}
|
|
}
|