42 lines
1.0 KiB
PHP
42 lines
1.0 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'];
|
|
}
|
|
final public function getServiceInfoUID(): int|null
|
|
{
|
|
return $this->attributes['serviceinfo_uid'];
|
|
}
|
|
//기본기능용
|
|
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'] ?? 0;
|
|
}
|
|
public function getType(): string
|
|
{
|
|
return $this->attributes['type'] ?? "";
|
|
}
|
|
public function getIP(): string|null
|
|
{
|
|
return $this->attributes['ip'] ?? null;
|
|
}
|
|
}
|