63 lines
1.7 KiB
PHP
63 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Customer;
|
|
|
|
use App\Entities\Customer\ServiceHistoryEntity;
|
|
use App\Models\Customer\ServiceHistoryModel;
|
|
use App\Services\Customer\ServiceService;
|
|
use CodeIgniter\HTTP\IncomingRequest;
|
|
|
|
class ServiceHistoryService extends CustomerService
|
|
{
|
|
protected ?IncomingRequest $request = null;
|
|
private ?ServiceService $_serviceService = null;
|
|
public function __construct(?IncomingRequest $request = null)
|
|
{
|
|
parent::__construct($request);
|
|
$this->addClassName('ServiceHistory');
|
|
}
|
|
public function getModelClass(): ServiceHistoryModel
|
|
{
|
|
return new ServiceHistoryModel();
|
|
}
|
|
public function getEntityClass(): ServiceHistoryEntity
|
|
{
|
|
return new ServiceHistoryEntity();
|
|
}
|
|
public function getServiceService(): ServiceService
|
|
{
|
|
if (!$this->_serviceService) {
|
|
$this->_serviceService = new ServiceService($this->request);
|
|
}
|
|
return $this->_serviceService;
|
|
}
|
|
public function getFormFields(): array
|
|
{
|
|
return [
|
|
"serviceinfo_uid",
|
|
"title",
|
|
"description",
|
|
];
|
|
}
|
|
public function getFilterFields(): array
|
|
{
|
|
return ["serviceinfo_uid", 'status'];
|
|
}
|
|
public function getBatchJobFields(): array
|
|
{
|
|
return ['status'];
|
|
}
|
|
public function getIndexFields(): array
|
|
{
|
|
return ['serviceinfo_uid', 'title', 'status', 'created_at'];
|
|
}
|
|
//Entity의 관련객체정의용
|
|
protected function setRelatedEntity(mixed $entity): ServiceHistoryEntity
|
|
{
|
|
//서비스정보정의
|
|
$entity->setService($this->getClient($entity->getClientUID()));
|
|
return $entity;
|
|
}
|
|
//기본 기능부분
|
|
}
|