97 lines
2.6 KiB
PHP
97 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace App\Entities\Customer;
|
|
|
|
use App\Entities\Equipment\ServerEntity;
|
|
use App\Entities\PaymentEntity;
|
|
use App\Models\Customer\ServiceModel;
|
|
|
|
class ServiceEntity extends CustomerEntity
|
|
{
|
|
const PK = ServiceModel::PK;
|
|
const TITLE = ServiceModel::TITLE;
|
|
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
|
public function setServerEntity(ServerEntity $entity): self
|
|
{
|
|
$this->attributes['serverEntity'] = $entity;
|
|
return $this;
|
|
}
|
|
final public function getServerEntity(): ServerEntity|null
|
|
{
|
|
return $this->attributes['serverEntity'];
|
|
}
|
|
final public function setPaymentEntity(PaymentEntity $entity): self
|
|
{
|
|
$this->attributes['paymentEntity'] = $entity;
|
|
return $this;
|
|
}
|
|
final public function getPaymentEntity(): PaymentEntity|null
|
|
{
|
|
return $this->attributes['paymentEntity'];
|
|
}
|
|
final public function getUserUID(): int|null
|
|
{
|
|
return $this->attributes['user_uid'];
|
|
}
|
|
final public function getClientInfoUID(): int
|
|
{
|
|
return $this->attributes['clientinfo_uid'];
|
|
}
|
|
final public function getServerInfoUID(): int
|
|
{
|
|
return $this->attributes['serverinfo_uid'];
|
|
}
|
|
final public function getPaymentUID(): string|null
|
|
{
|
|
return $this->attributes['payment_uid'];
|
|
}
|
|
//기본기능용
|
|
public function getCustomTitle(string $field = ServiceModel::TITLE): string
|
|
{
|
|
return sprintf("[%s]%s", $this->getCode(), $this->$field);
|
|
}
|
|
final public function getCode(): string
|
|
{
|
|
return $this->attributes['code'];
|
|
}
|
|
final public function getSite(): string
|
|
{
|
|
return $this->attributes['site'];
|
|
}
|
|
final public function getLocation(): string
|
|
{
|
|
return $this->attributes['location'];
|
|
}
|
|
final public function getBillingAt(): string
|
|
{
|
|
return $this->attributes['billing_at'];
|
|
}
|
|
//청구금액->기본:상면비+회선비+서버금액(price)+서버파트연결(월비용)-할인액
|
|
final public function getSale(): int
|
|
{
|
|
return $this->attributes['sale'];
|
|
}
|
|
final public function getAmount(): int
|
|
{
|
|
return $this->attributes['amount'];
|
|
}
|
|
//상면비
|
|
final public function getRack(): int
|
|
{
|
|
return $this->attributes['rack'];
|
|
}
|
|
//회선비
|
|
final public function getLine(): int
|
|
{
|
|
return $this->attributes['line'];
|
|
}
|
|
final public function getStartAt(): string
|
|
{
|
|
return $this->attributes['start_at'];
|
|
}
|
|
public function getHistory(): string|null
|
|
{
|
|
return $this->attributes['history'];
|
|
}
|
|
}
|