dbms/app/Entities/Customer/ServiceEntity.php
2025-05-21 17:18:03 +09:00

30 lines
791 B
PHP

<?php
namespace App\Entities\Customer;
use App\Entities\Equipment\PartEntity;
use App\Models\Customer\ServiceModel;
class ServiceEntity extends CustomerEntity
{
const PK = ServiceModel::PK;
const TITLE = ServiceModel::TITLE;
public function getServerInfoUID()
{
return $this->attributes['serverinfo_uid'];
}
public function getPartEntities(string $type): array
{
return $this->attributes[$type] ?? [];
}
public function addPartEntity(string $type, PartEntity $partEntity): void
{
if (!isset($this->attributes[$type])) {
$this->attributes[$type] = [];
}
$this->attributes[$type][] = $partEntity;
// $this->attributes[$type] = array_unique($this->attributes[$type], SORT_REGULAR);
}
}