87 lines
2.2 KiB
PHP
87 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace App\Entities\Equipment;
|
|
|
|
use App\Entities\PaymentEntity;
|
|
use App\Models\Equipment\ServerPartModel;
|
|
|
|
class ServerPartEntity extends EquipmentEntity
|
|
{
|
|
const PK = ServerPartModel::PK;
|
|
const TITLE = ServerPartModel::TITLE;
|
|
public function setPartEntity(mixed $entity): self
|
|
{
|
|
$this->attributes['partEntity'] = $entity;
|
|
return $this;
|
|
}
|
|
//여러클래스존재가능
|
|
public function getPartEntity(): mixed
|
|
{
|
|
return $this->attributes['partEntity'];
|
|
}
|
|
final public function setPaymentEntity(PaymentEntity $entity): self
|
|
{
|
|
$this->attributes['paymentEntity'] = $entity;
|
|
return $this;
|
|
}
|
|
final public function getPaymentEntity(): PaymentEntity|null
|
|
{
|
|
return $this->attributes['paymentEntity'] ?? null;
|
|
}
|
|
final public function getServerInfoUID(): int|null
|
|
{
|
|
return $this->attributes['serverinfo_uid'] ?? null;
|
|
}
|
|
public function getPartUID(): int|null
|
|
{
|
|
return $this->attributes['part_uid'] ?? null;
|
|
}
|
|
final public function getClientInfoUID(): int|null
|
|
{
|
|
return $this->attributes['clientinfo_uid'] ?? null;
|
|
}
|
|
final public function getServiceInfoUID(): int|null
|
|
{
|
|
return $this->attributes['serviceinfo_uid'] ?? null;
|
|
}
|
|
final public function getPaymentUID(): int|null
|
|
{
|
|
return $this->attributes['payment_uid'] ?? null;
|
|
}
|
|
//기본기능용
|
|
public function getPrice(): int
|
|
{
|
|
return $this->getPartEntity() !== null ? $this->getPartEntity()->getPrice() : 0;
|
|
}
|
|
public function getTotalAmount(): int
|
|
{
|
|
return $this->getAmount() * $this->getCnt();
|
|
}
|
|
|
|
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'];
|
|
}
|
|
//리스트에서 상태표시용
|
|
public function getStatus(): string
|
|
{
|
|
return self::DEFAULT_STATUS;
|
|
}
|
|
}
|