63 lines
2.0 KiB
PHP
63 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers\Admin\Equipment;
|
|
|
|
use App\Controllers\Admin\AdminController;
|
|
use App\Services\Customer\ClientService;
|
|
use App\Services\Equipment\LineService;
|
|
use App\Services\Equipment\ServerService;
|
|
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
abstract class EquipmentController extends AdminController
|
|
{
|
|
private ?ClientService $_clientService = null;
|
|
private ?LineService $_lineService = null;
|
|
private ?ServerService $_serverService = null;
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
parent::initController($request, $response, $logger);
|
|
$this->uri_path .= 'equipment/';
|
|
// $this->view_path .= "equipment" . DIRECTORY_SEPARATOR;
|
|
}
|
|
final public function getClientService(): ClientService
|
|
{
|
|
if (!$this->_clientService) {
|
|
$this->_clientService = new ClientService($this->request);
|
|
}
|
|
return $this->_clientService;
|
|
}
|
|
final public function getLineService(): LineService
|
|
{
|
|
if (!$this->_lineService) {
|
|
$this->_lineService = new LineService($this->request);
|
|
}
|
|
return $this->_lineService;
|
|
}
|
|
final public function getServerService(): ServerService
|
|
{
|
|
if (!$this->_serverService) {
|
|
$this->_serverService = new ServerService($this->request);
|
|
}
|
|
return $this->_serverService;
|
|
}
|
|
|
|
protected function getFormFieldOption(string $field, array $options): array
|
|
{
|
|
switch ($field) {
|
|
case 'clientinfo_uid':
|
|
$options = $this->getClientService()->getFormFieldOption($field);
|
|
// echo $this->getUserModel()->getLastQuery();
|
|
// dd($options);
|
|
break;
|
|
default:
|
|
$options = parent::getFormFieldOption($field, $options);
|
|
break;
|
|
}
|
|
return $options;
|
|
}
|
|
//Index,FieldForm관련
|
|
}
|