59 lines
1.5 KiB
PHP
59 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Entities\Equipment;
|
|
|
|
use App\Models\Equipment\ServerPartModel;
|
|
|
|
class ServerPartEntity extends EquipmentEntity
|
|
{
|
|
const PK = ServerPartModel::PK;
|
|
const TITLE = ServerPartModel::TITLE;
|
|
const DEFAULT_STATUS = null;
|
|
|
|
public function setPartEntity(mixed $entity): void
|
|
{
|
|
$this->attributes['partEntity'] = $entity;
|
|
}
|
|
public function getPartEntity(): mixed
|
|
{
|
|
return $this->attributes['partEntity'] ?? null;
|
|
}
|
|
public function getTitle(): string
|
|
{
|
|
return $this->getPartEntity() !== null ? sprintf(
|
|
"%s%s",
|
|
$this->getBilling() === "" ? "" : ($this->getBilling() === PAYMENT['BILLING']["ONETIME"] ? ICONS['ONETIME'] : ICONS['MONTH']),
|
|
$this->getPartEntity()->getTitle()
|
|
) : "";
|
|
}
|
|
public function getPrice(): int
|
|
{
|
|
return $this->getPartEntity() !== null ? $this->getPartEntity()->getPrice() : 0;
|
|
}
|
|
//기본기능용
|
|
public function getPartUID(): int
|
|
{
|
|
return $this->attributes['part_uid'];
|
|
}
|
|
public function getType(): string
|
|
{
|
|
return $this->attributes['type'];
|
|
}
|
|
public function getBilling(): string
|
|
{
|
|
return $this->attributes['billing'];
|
|
}
|
|
public function getAmount(): int
|
|
{
|
|
return $this->attributes['amount'];
|
|
}
|
|
public function getCnt(): int
|
|
{
|
|
return $this->attributes['cnt'];
|
|
}
|
|
public function getExtra(): string|null
|
|
{
|
|
return $this->attributes['extra'] ?? null;
|
|
}
|
|
}
|