dbms/app/Entities/Customer/ServiceEntity.php
2025-06-16 17:10:16 +09:00

51 lines
1.3 KiB
PHP

<?php
namespace App\Entities\Customer;
use App\Entities\Customer\ClientEntity;
use App\Models\Customer\ServiceModel;
class ServiceEntity extends CustomerEntity
{
const PK = ServiceModel::PK;
const TITLE = ServiceModel::TITLE;
private ?ClientEntity $_ownerEntity = null;
//고객정보객체-상속
//관리자정보객체
final public function getOwnerUID(): int
{
return intval($this->attributes['ownerinfo_uid']);
}
final public function getOwner(): ClientEntity|null
{
return $this->_ownerEntity;
}
final public function setOwner(ClientEntity $ownerEntity): void
{
$this->_ownerEntity = $ownerEntity;
}
//타 객체정의 부분
public function getSerialCode(): string
{
return "S" . $this->getPK();
}
//서버코드
public function getCode(): string
{
return $this->attributes['code'];
}
final public function getBillingAt(): string
{
return $this->attributes['billing_at'];
}
public function getItemEntities(string $type): array
{
return $this->attributes[$type] ?? [];
}
public function setItemEntities(string $type, array $itemEntities): void
{
$this->attributes[$type] = $itemEntities;
// $this->attributes[$type] = array_unique($this->attributes[$type], SORT_REGULAR);
}
}