63 lines
1.9 KiB
PHP
63 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;
|
|
const STATUS_AVAILABLE = "available";
|
|
const STATUS_OCCUPIED = "occupied";
|
|
const STATUS_FORBIDDEN = "forbidden";
|
|
const DEFAULT_STATUS = self::STATUS_AVAILABLE;
|
|
|
|
public function setServerPartEntity(string $partType, ServerPartENtity $entity): void
|
|
{
|
|
if (!array_key_exists('serverPartEntities', $this->attributes)) {
|
|
$this->attributes['serverPartEntities'] = [];
|
|
}
|
|
$this->attributes['serverPartEntities'][$partType] = $entity;
|
|
}
|
|
public function getServerPartEntity(string $partType): ServerPartENtity|null
|
|
{
|
|
if (!array_key_exists('serverPartEntities', $this->attributes)) {
|
|
return null;
|
|
}
|
|
if (!array_key_exists($partType, $this->attributes['serverPartEntities'])) {
|
|
return null;
|
|
}
|
|
return $this->attributes['serverPartEntities'][$partType];
|
|
}
|
|
public function setIPEntities(array $entities): void
|
|
{
|
|
$this->attributes['ipEntities'] = $entities;
|
|
}
|
|
public function getIPEntities(): array
|
|
{
|
|
return $this->attributes['ipEntities'] ?? [];
|
|
}
|
|
public function setCSEntities(array $entities): void
|
|
{
|
|
$this->attributes['csEntities'] = $entities;
|
|
}
|
|
public function getCSEntities(): array
|
|
{
|
|
return $this->attributes['csEntities'] ?? [];
|
|
}
|
|
//기본기능용
|
|
public function getCode(): string
|
|
{
|
|
return $this->attributes['code'];
|
|
}
|
|
public function getClientInfoUID(): int|null
|
|
{
|
|
return $this->attributes['clientinfo_uid'] ?? null;
|
|
}
|
|
public function getServiceInfoUID(): int|null
|
|
{
|
|
return $this->attributes['serviceinfo_uid'] ?? null;
|
|
}
|
|
}
|