67 lines
1.4 KiB
PHP
67 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Entities\Equipment;
|
|
|
|
use App\Models\Equipment\CHASSISModel;
|
|
|
|
class CHASSISEntity extends EquipmentEntity
|
|
{
|
|
const PK = CHASSISModel::PK;
|
|
const TITLE = CHASSISModel::TITLE;
|
|
protected $attributes = [
|
|
'title' => '',
|
|
'price' => 0,
|
|
'used' => 0,
|
|
'stock' => 0,
|
|
'status' => '',
|
|
'cpu_cnt' => 0,
|
|
'ram_cnt' => 0,
|
|
'disk_cnt' => 0,
|
|
];
|
|
public function __construct(array|null $data = null)
|
|
{
|
|
parent::__construct($data);
|
|
}
|
|
public function getCPUInfoUid(): int|null
|
|
{
|
|
return $this->cpuinfo_uid ?? null;
|
|
}
|
|
public function getRAMInfoUid(): int|null
|
|
{
|
|
return $this->raminfo_uid ?? null;
|
|
}
|
|
public function getDISKInfoUid(): int|null
|
|
{
|
|
return $this->diskinfo_uid ?? null;
|
|
}
|
|
//기본기능
|
|
public function getPrice(): int
|
|
{
|
|
return $this->price ?? 0;
|
|
}
|
|
public function getStock(): int
|
|
{
|
|
return $this->stock ?? 0;
|
|
}
|
|
public function getUsed(): int
|
|
{
|
|
return $this->used ?? 0;
|
|
}
|
|
public function getAvailable(): int
|
|
{
|
|
return $this->getStock() - $this->getUsed();
|
|
}
|
|
public function getCPUCnt(): int
|
|
{
|
|
return $this->cpu_cnt ?? 0;
|
|
}
|
|
public function getRAMCnt(): int
|
|
{
|
|
return $this->ram_cnt ?? 0;
|
|
}
|
|
public function getDISKCnt(): int
|
|
{
|
|
return $this->disk_cnt ?? 0;
|
|
}
|
|
}
|