dbms/app/Controllers/Admin/Customer/CustomerController.php
2025-07-10 14:42:01 +09:00

39 lines
1.3 KiB
PHP

<?php
namespace App\Controllers\Admin\Customer;
use App\Controllers\Admin\AdminController;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Services\Customer\ServiceService;
abstract class CustomerController extends AdminController
{
private ?ServiceService $_serviceService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
}
public function getServiceService(): ServiceService
{
if (!$this->_serviceService) {
$this->_serviceService = new ServiceService();
}
return $this->_serviceService;
}
//Index,FieldForm관련
//Service,ServicePaymentController사용
//LINE,IP,SERVER등 추가 FilterOption 셋팅용
final protected function setFilterOptionsByItemType(): void
{
//LINE,IP,SERVER등 추가 FilterOption 셋팅용
foreach (SERVICE_ITEM_TYPES as $item_type => $label) {
$this->setFieldRule($item_type, $this->getFormFieldRule($this->getAction(), $item_type));
$this->setFilterFieldOption($item_type, $this->getServiceService()->getFilterOptionsByItemType($item_type));
}
}
}