dbms/app/Entities/Customer/ServiceItemEntity.php
2025-06-13 16:44:28 +09:00

61 lines
1.7 KiB
PHP

<?php
namespace App\Entities\Customer;
use App\Entities\Customer\ServiceEntity;
use App\Models\Customer\ServiceItemModel;
class ServiceItemEntity extends CustomerEntity
{
const PK = ServiceItemModel::PK;
const TITLE = ServiceItemModel::TITLE;
private ?ServiceEntity $_serviceEntity = null;
//서비스정보객체
final public function getServiceUid(): int
{
return intval($this->attributes['serviceinfo_uid']);
}
final public function getService(): ServiceEntity|null
{
return $this->_serviceEntity;
}
final public function setService(ServiceEntity $serviceEntity): void
{
$this->_serviceEntity = $serviceEntity;
}
//타 객체정의 부분
public function getItemType(): string
{
return $this->attributes['item_type'];
}
public function getItemUid(): int
{
return intval($this->attributes['item_uid']);
}
public function getBillingCycle(): string
{
return $this->attributes['billing_cycle'];
}
public function getPrice(): int
{
return intval($this->attributes['price']);
}
public function getAmount(): int
{
return intval($this->attributes['amount']);
}
public function getView_Price(): string
{
return sprintf("원가:%s원 , 제공가:%s원", number_format($this->getPrice()), number_format($this->getAmount()));
}
public function getView_Sale(): string
{
return $this->getPrice() > $this->getAmount() ? "" : ICONS['SALE_DOWN'];
}
public function getView_BillingCycle(): string
{
return $this->getBillingCycle() == "month" ? "" : ICONS['ONETIME'];;
}
}