50 lines
1.3 KiB
PHP
50 lines
1.3 KiB
PHP
<?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(string $field = ServerModel::TITLE): string
|
|
{
|
|
return sprintf("[%s]%s", $this->getCode(), $this->$field);
|
|
}
|
|
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;
|
|
}
|
|
}
|