86 lines
2.2 KiB
PHP
86 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): ServerPartEntity
|
|
{
|
|
$this->attributes['partEntity'] = $entity;
|
|
return $this;
|
|
}
|
|
//여러클래스존재가능
|
|
public function getPartEntity(): mixed
|
|
{
|
|
return $this->attributes['partEntity'] ?? null;
|
|
}
|
|
final public function setPaymentEntity(PaymentEntity $entity): ServerPartEntity
|
|
{
|
|
$this->attributes['paymentEntity'] = $entity;
|
|
return $this;
|
|
}
|
|
final public function getPaymentEntity(): PaymentEntity
|
|
{
|
|
return $this->attributes['paymentEntity'];
|
|
}
|
|
public function getPartUID(): int
|
|
{
|
|
return intval($this->attributes['part_uid']) ?? 0;
|
|
}
|
|
final public function getUserUID(): string
|
|
{
|
|
return $this->attributes['user_uid'];
|
|
}
|
|
final public function getClientInfoUID(): string
|
|
{
|
|
return $this->attributes['clientinfo_uid'];
|
|
}
|
|
final public function getServiceInfoUID(): string
|
|
{
|
|
return $this->attributes['serviceinfo_uid'];
|
|
}
|
|
final public function getServerInfoUID(): string
|
|
{
|
|
return $this->attributes['serverinfo_uid'];
|
|
}
|
|
final public function getPaymentInfoUID(): string|null
|
|
{
|
|
return $this->attributes['payment_uid'] ?? null;
|
|
}
|
|
//기본기능용
|
|
public function getPrice(): int
|
|
{
|
|
return $this->getPartEntity() !== null ? $this->getPartEntity()->getPrice() : 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;
|
|
}
|
|
}
|