dbmsv2/app/Entities/Equipment/ServerPartEntity.php
2025-09-18 17:17:11 +09:00

54 lines
1.3 KiB
PHP

<?php
namespace App\Entities\Equipment;
use App\Models\Equipment\ServerPartModel;
class ServerPartEntity extends EquipmentEntity
{
const PK = ServerPartModel::PK;
const TITLE = ServerPartModel::TITLE;
public function setPartEntity(mixed $entity): ServerPartEntity
{
$this->attributes['partEntity'] = $entity;
return $this;
}
public function getPartEntity(): mixed
{
return $this->attributes['partEntity'] ?? null;
}
public function getPrice(): int
{
return $this->getPartEntity() !== null ? $this->getPartEntity()->getPrice() : 0;
}
//기본기능용
public function getPartUID(): int
{
return intval($this->attributes['part_uid']) ?? 0;
}
public function getType(): string
{
return $this->attributes['type'] ?? "";
}
public function getBilling(): string
{
return $this->attributes['billing'] ?? "";
}
public function getAmount(): int
{
return $this->attributes['amount'] ?? 0;
}
public function getCnt(): int
{
return $this->attributes['cnt'] ?? 0;
}
public function getExtra(): string
{
return $this->attributes['extra'] ?? "";
}
public function getStatus(): string
{
return self::DEFAULT_STATUS;
}
}