dbms_init...1
This commit is contained in:
parent
c5ed6eb2de
commit
66cda3dbea
@ -23,7 +23,7 @@ class AccountController extends CustomerController
|
|||||||
public function getService(): AccountService
|
public function getService(): AccountService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new AccountService($this->request);
|
$this->_service = new AccountService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class ClientController extends CustomerController
|
|||||||
public function getService(): ClientService
|
public function getService(): ClientService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new ClientService($this->request);
|
$this->_service = new ClientService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class CouponController extends CustomerController
|
|||||||
public function getService(): CouponService
|
public function getService(): CouponService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new CouponService($this->request);
|
$this->_service = new CouponService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ abstract class CustomerController extends AdminController
|
|||||||
public function getServiceService(): ServiceService
|
public function getServiceService(): ServiceService
|
||||||
{
|
{
|
||||||
if (!$this->_serviceService) {
|
if (!$this->_serviceService) {
|
||||||
$this->_serviceService = new ServiceService($this->request);
|
$this->_serviceService = new ServiceService();
|
||||||
}
|
}
|
||||||
return $this->_serviceService;
|
return $this->_serviceService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class PointController extends CustomerController
|
|||||||
public function getService(): PointService
|
public function getService(): PointService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new PointService($this->request);
|
$this->_service = new PointService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class ServiceController extends CustomerController
|
|||||||
public function getService(): ServiceService
|
public function getService(): ServiceService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new ServiceService($this->request);
|
$this->_service = new ServiceService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
@ -42,14 +42,14 @@ class ServiceController extends CustomerController
|
|||||||
public function getCodeService(): CodeService
|
public function getCodeService(): CodeService
|
||||||
{
|
{
|
||||||
if (!$this->_codeService) {
|
if (!$this->_codeService) {
|
||||||
$this->_codeService = new CodeService($this->request);
|
$this->_codeService = new CodeService();
|
||||||
}
|
}
|
||||||
return $this->_codeService;
|
return $this->_codeService;
|
||||||
}
|
}
|
||||||
public function getServicePaymentService(): ServicePaymentService
|
public function getServicePaymentService(): ServicePaymentService
|
||||||
{
|
{
|
||||||
if (!$this->_servicePaymentService) {
|
if (!$this->_servicePaymentService) {
|
||||||
$this->_servicePaymentService = new ServicePaymentService($this->request);
|
$this->_servicePaymentService = new ServicePaymentService();
|
||||||
}
|
}
|
||||||
return $this->_servicePaymentService;
|
return $this->_servicePaymentService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class ServiceHistoryController extends CustomerController
|
|||||||
public function getService(): ServiceHistoryService
|
public function getService(): ServiceHistoryService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new ServiceHistoryService($this->request);
|
$this->_service = new ServiceHistoryService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
@ -41,7 +41,7 @@ class ServiceHistoryController extends CustomerController
|
|||||||
public function getServiceService(): ServiceService
|
public function getServiceService(): ServiceService
|
||||||
{
|
{
|
||||||
if (!$this->_serviceService) {
|
if (!$this->_serviceService) {
|
||||||
$this->_serviceService = new ServiceService($this->request);
|
$this->_serviceService = new ServiceService();
|
||||||
}
|
}
|
||||||
return $this->_serviceService;
|
return $this->_serviceService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class ServiceItemController extends CustomerController
|
|||||||
public function getService(): ServiceItemService
|
public function getService(): ServiceItemService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new ServiceItemService($this->request);
|
$this->_service = new ServiceItemService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ class ServiceItemController extends CustomerController
|
|||||||
public function getServiceService(): ServiceService
|
public function getServiceService(): ServiceService
|
||||||
{
|
{
|
||||||
if (!$this->_serviceService) {
|
if (!$this->_serviceService) {
|
||||||
$this->_serviceService = new ServiceService($this->request);
|
$this->_serviceService = new ServiceService();
|
||||||
}
|
}
|
||||||
return $this->_serviceService;
|
return $this->_serviceService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class ServicePaymentController extends CustomerController
|
|||||||
public function getService(): ServicePaymentService
|
public function getService(): ServicePaymentService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new ServicePaymentService($this->request);
|
$this->_service = new ServicePaymentService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
@ -46,14 +46,14 @@ class ServicePaymentController extends CustomerController
|
|||||||
public function getServiceService(): ServiceService
|
public function getServiceService(): ServiceService
|
||||||
{
|
{
|
||||||
if (!$this->_serviceService) {
|
if (!$this->_serviceService) {
|
||||||
$this->_serviceService = new ServiceService($this->request);
|
$this->_serviceService = new ServiceService();
|
||||||
}
|
}
|
||||||
return $this->_serviceService;
|
return $this->_serviceService;
|
||||||
}
|
}
|
||||||
public function getClientService(): ClientService
|
public function getClientService(): ClientService
|
||||||
{
|
{
|
||||||
if (!$this->_clientService) {
|
if (!$this->_clientService) {
|
||||||
$this->_clientService = new ClientService($this->request);
|
$this->_clientService = new ClientService();
|
||||||
}
|
}
|
||||||
return $this->_clientService;
|
return $this->_clientService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class CodeController extends EquipmentController
|
|||||||
public function getService(): CodeService
|
public function getService(): CodeService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new CodeService($this->request);
|
$this->_service = new CodeService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class DomainController extends EquipmentController
|
|||||||
public function getService(): DomainService
|
public function getService(): DomainService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new DomainService($this->request);
|
$this->_service = new DomainService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ abstract class EquipmentController extends AdminController
|
|||||||
final public function getClientService(): ClientService
|
final public function getClientService(): ClientService
|
||||||
{
|
{
|
||||||
if (!$this->_clientService) {
|
if (!$this->_clientService) {
|
||||||
$this->_clientService = new ClientService($this->request);
|
$this->_clientService = new ClientService();
|
||||||
}
|
}
|
||||||
return $this->_clientService;
|
return $this->_clientService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class CpuController extends PartController
|
|||||||
public function getService(): CpuService
|
public function getService(): CpuService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new CpuService($this->request);
|
$this->_service = new CpuService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class DefenceController extends PartController
|
|||||||
public function getService(): DefenceService
|
public function getService(): DefenceService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new DefenceService($this->request);
|
$this->_service = new DefenceService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class IpController extends PartController
|
|||||||
public function getService(): IpService
|
public function getService(): IpService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new IpService($this->request);
|
$this->_service = new IpService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
@ -40,7 +40,7 @@ class IpController extends PartController
|
|||||||
final public function getLineService(): LineService
|
final public function getLineService(): LineService
|
||||||
{
|
{
|
||||||
if (!$this->_lineService) {
|
if (!$this->_lineService) {
|
||||||
$this->_lineService = new LineService($this->request);
|
$this->_lineService = new LineService();
|
||||||
}
|
}
|
||||||
return $this->_lineService;
|
return $this->_lineService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class LineController extends PartController
|
|||||||
public function getService(): LineService
|
public function getService(): LineService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new LineService($this->request);
|
$this->_service = new LineService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
@ -41,7 +41,7 @@ class LineController extends PartController
|
|||||||
final public function getIpService(): IpService
|
final public function getIpService(): IpService
|
||||||
{
|
{
|
||||||
if (!$this->_ipService) {
|
if (!$this->_ipService) {
|
||||||
$this->_ipService = new IpService($this->request);
|
$this->_ipService = new IpService();
|
||||||
}
|
}
|
||||||
return $this->_ipService;
|
return $this->_ipService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class RamController extends PartController
|
|||||||
public function getService(): RamService
|
public function getService(): RamService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new RamService($this->request);
|
$this->_service = new RamService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class SoftwareController extends PartController
|
|||||||
public function getService(): SoftwareService
|
public function getService(): SoftwareService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new SoftwareService($this->request);
|
$this->_service = new SoftwareService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class StorageController extends PartController
|
|||||||
public function getService(): StorageService
|
public function getService(): StorageService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new StorageService($this->request);
|
$this->_service = new StorageService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class ServerController extends EquipmentController
|
|||||||
public function getService(): ServerService
|
public function getService(): ServerService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new ServerService($this->request);
|
$this->_service = new ServerService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class Home extends AdminController
|
|||||||
final public function getService(): ServiceService
|
final public function getService(): ServiceService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new ServiceService($this->request);
|
$this->_service = new ServiceService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
@ -41,7 +41,7 @@ class Home extends AdminController
|
|||||||
final public function getServicePaymentService(): ServicePaymentService
|
final public function getServicePaymentService(): ServicePaymentService
|
||||||
{
|
{
|
||||||
if (!$this->_servicePaymentService) {
|
if (!$this->_servicePaymentService) {
|
||||||
$this->_servicePaymentService = new ServicePaymentService($this->request);
|
$this->_servicePaymentService = new ServicePaymentService();
|
||||||
}
|
}
|
||||||
return $this->_servicePaymentService;
|
return $this->_servicePaymentService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class MyLogController extends AdminController
|
|||||||
final public function getService(): MyLogService
|
final public function getService(): MyLogService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new MyLogService($this->request);
|
$this->_service = new MyLogService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class UserController extends AdminController
|
|||||||
final public function getService(): UserService
|
final public function getService(): UserService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new UserService($this->request);
|
$this->_service = new UserService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ class LocalController extends AuthController
|
|||||||
final public function getService(): LocalService
|
final public function getService(): LocalService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new LocalService($this->request);
|
$this->_service = new LocalService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,21 +24,21 @@ class Payment extends BaseController
|
|||||||
public function getServiceService(): ServiceService
|
public function getServiceService(): ServiceService
|
||||||
{
|
{
|
||||||
if (!$this->_serviceService) {
|
if (!$this->_serviceService) {
|
||||||
$this->_serviceService = new ServiceService($this->request);
|
$this->_serviceService = new ServiceService();
|
||||||
}
|
}
|
||||||
return $this->_serviceService;
|
return $this->_serviceService;
|
||||||
}
|
}
|
||||||
public function getServiceItemService(): ServiceItemService
|
public function getServiceItemService(): ServiceItemService
|
||||||
{
|
{
|
||||||
if (!$this->_servicItemeService) {
|
if (!$this->_servicItemeService) {
|
||||||
$this->_servicItemeService = new ServiceItemService($this->request);
|
$this->_servicItemeService = new ServiceItemService();
|
||||||
}
|
}
|
||||||
return $this->_servicItemeService;
|
return $this->_servicItemeService;
|
||||||
}
|
}
|
||||||
public function getServicePaymentService(): ServicePaymentService
|
public function getServicePaymentService(): ServicePaymentService
|
||||||
{
|
{
|
||||||
if (!$this->_servicePaymentService) {
|
if (!$this->_servicePaymentService) {
|
||||||
$this->_servicePaymentService = new ServicePaymentService($this->request);
|
$this->_servicePaymentService = new ServicePaymentService();
|
||||||
}
|
}
|
||||||
return $this->_servicePaymentService;
|
return $this->_servicePaymentService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,7 @@ abstract class CommonController extends BaseController
|
|||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->isLoggedIn = false;
|
$this->isLoggedIn = false;
|
||||||
|
$this->uri = $request->getUri();
|
||||||
if ($this->getMyAuth()->isLoggedIn()) {
|
if ($this->getMyAuth()->isLoggedIn()) {
|
||||||
$this->isLoggedIn = true;
|
$this->isLoggedIn = true;
|
||||||
$this->myAuthName = $this->getMyAuth()->getNameByAuthInfo();
|
$this->myAuthName = $this->getMyAuth()->getNameByAuthInfo();
|
||||||
@ -61,7 +62,7 @@ abstract class CommonController extends BaseController
|
|||||||
final public function getMyLogService(): mixed
|
final public function getMyLogService(): mixed
|
||||||
{
|
{
|
||||||
if (!$this->_myLogService) {
|
if (!$this->_myLogService) {
|
||||||
$this->_myLogService = new MyLogService($this->request);
|
$this->_myLogService = new MyLogService();
|
||||||
}
|
}
|
||||||
return $this->_myLogService;
|
return $this->_myLogService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class AuthHelper extends CommonHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(UserModel::TITLE);
|
$this->setTitleField(UserModel::TITLE);
|
||||||
}
|
}
|
||||||
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
||||||
|
|||||||
@ -2,18 +2,12 @@
|
|||||||
|
|
||||||
namespace App\Helpers;
|
namespace App\Helpers;
|
||||||
|
|
||||||
use CodeIgniter\HTTP\IncomingRequest;
|
|
||||||
|
|
||||||
class CommonHelper
|
class CommonHelper
|
||||||
{
|
{
|
||||||
private $_myAuth = null;
|
private $_myAuth = null;
|
||||||
private $_viewDatas = [];
|
private $_viewDatas = [];
|
||||||
private $_titleField = "";
|
private $_titleField = "";
|
||||||
private ?IncomingRequest $_request = null;
|
protected function __construct() {}
|
||||||
protected function __construct(?IncomingRequest $request = null)
|
|
||||||
{
|
|
||||||
$this->_request = $request;
|
|
||||||
}
|
|
||||||
final protected function getMyAuth(): mixed
|
final protected function getMyAuth(): mixed
|
||||||
{
|
{
|
||||||
if (!$this->_myAuth) {
|
if (!$this->_myAuth) {
|
||||||
@ -21,10 +15,6 @@ class CommonHelper
|
|||||||
}
|
}
|
||||||
return $this->_myAuth;
|
return $this->_myAuth;
|
||||||
}
|
}
|
||||||
final public function getRequest(): IncomingRequest|null
|
|
||||||
{
|
|
||||||
return $this->_request;
|
|
||||||
}
|
|
||||||
final public function setTitleField(string $field): void
|
final public function setTitleField(string $field): void
|
||||||
{
|
{
|
||||||
$this->_titleField = $field;
|
$this->_titleField = $field;
|
||||||
@ -353,7 +343,7 @@ class CommonHelper
|
|||||||
if (isset($viewDatas['order_field']) && $viewDatas['order_field'] == $field) {
|
if (isset($viewDatas['order_field']) && $viewDatas['order_field'] == $field) {
|
||||||
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
|
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
|
||||||
}
|
}
|
||||||
$query = $this->getRequest()->getUri()->getQuery(['except' => ['order_field', 'order_value']]);
|
$query = $viewDatas['uri']->getQuery(['except' => ['order_field', 'order_value']]);
|
||||||
$query .= empty($query) ? "" : "&";
|
$query .= empty($query) ? "" : "&";
|
||||||
$query .= "order_field={$field}&order_value=";
|
$query .= "order_field={$field}&order_value=";
|
||||||
$query .= isset($viewDatas['order_value']) && $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
$query .= isset($viewDatas['order_value']) && $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
||||||
@ -367,13 +357,13 @@ class CommonHelper
|
|||||||
{
|
{
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'create':
|
case 'create':
|
||||||
// echo current_url() . '/' . $action . '?' . $this->getRequest()->getUri()->getQuery();
|
// echo current_url() . '/' . $action . '?' . $viewDatas['uri']->getQuery();
|
||||||
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||||
$action = form_label(
|
$action = form_label(
|
||||||
array_key_exists('label', $extras) ? $extras['label'] : ICONS['ADD'],
|
array_key_exists('label', $extras) ? $extras['label'] : ICONS['ADD'],
|
||||||
$action,
|
$action,
|
||||||
[
|
[
|
||||||
"data-src" => current_url() . '/' . $action . '?' . $this->getRequest()->getUri()->getQuery(),
|
"data-src" => current_url() . '/' . $action . '?' . $viewDatas['uri']->getQuery(),
|
||||||
"data-bs-toggle" => "modal",
|
"data-bs-toggle" => "modal",
|
||||||
"data-bs-target" => "#index_action_form",
|
"data-bs-target" => "#index_action_form",
|
||||||
...$extras
|
...$extras
|
||||||
@ -394,7 +384,7 @@ class CommonHelper
|
|||||||
$viewDatas['cnt'],
|
$viewDatas['cnt'],
|
||||||
$action,
|
$action,
|
||||||
[
|
[
|
||||||
"data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $this->getRequest()->getUri()->getQuery(),
|
"data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(),
|
||||||
"data-bs-toggle" => "modal",
|
"data-bs-toggle" => "modal",
|
||||||
"data-bs-target" => "#index_action_form",
|
"data-bs-target" => "#index_action_form",
|
||||||
...$extras
|
...$extras
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class AccountHelper extends CustomerHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(AccountModel::TITLE);
|
$this->setTitleField(AccountModel::TITLE);
|
||||||
}
|
}
|
||||||
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class ClientHelper extends CustomerHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(ClientModel::TITLE);
|
$this->setTitleField(ClientModel::TITLE);
|
||||||
}
|
}
|
||||||
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class CouponHelper extends CustomerHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(CouponModel::TITLE);
|
$this->setTitleField(CouponModel::TITLE);
|
||||||
}
|
}
|
||||||
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
||||||
|
|||||||
@ -9,6 +9,6 @@ abstract class CustomerHelper extends CommonHelper
|
|||||||
{
|
{
|
||||||
protected function __construct(?IncomingRequest $request = null)
|
protected function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class PointHelper extends CustomerHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: PointModel::TITLE);
|
$this->setTitleField(field: PointModel::TITLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ class ServiceHelper extends CustomerHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: ServiceModel::TITLE);
|
$this->setTitleField(field: ServiceModel::TITLE);
|
||||||
}
|
}
|
||||||
public function getFieldLabel(string $field, array $viewDatas, array $extras = []): string
|
public function getFieldLabel(string $field, array $viewDatas, array $extras = []): string
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class ServiceHistoryHelper extends CustomerHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: ServiceHistoryModel::TITLE);
|
$this->setTitleField(field: ServiceHistoryModel::TITLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class ServiceItemHelper extends CustomerHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: ServiceItemModel::TITLE);
|
$this->setTitleField(field: ServiceItemModel::TITLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class ServicePaymentHelper extends CustomerHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: ServicePaymentModel::TITLE);
|
$this->setTitleField(field: ServicePaymentModel::TITLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class CodeHelper extends EquipmentHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: CodeModel::TITLE);
|
$this->setTitleField(field: CodeModel::TITLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class DomainHelper extends EquipmentHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: DomainModel::TITLE);
|
$this->setTitleField(field: DomainModel::TITLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,6 @@ abstract class EquipmentHelper extends CommonHelper
|
|||||||
{
|
{
|
||||||
protected function __construct(?IncomingRequest $request = null)
|
protected function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class CpuHelper extends PartHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: CpuModel::TITLE);
|
$this->setTitleField(field: CpuModel::TITLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class DefenceHelper extends PartHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: DefenceModel::TITLE);
|
$this->setTitleField(field: DefenceModel::TITLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class IpHelper extends PartHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: IpModel::TITLE);
|
$this->setTitleField(field: IpModel::TITLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class LineHelper extends PartHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: LineModel::TITLE);
|
$this->setTitleField(field: LineModel::TITLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,6 @@ abstract class PartHelper extends EquipmentHelper
|
|||||||
{
|
{
|
||||||
protected function __construct(?IncomingRequest $request = null)
|
protected function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class RamHelper extends PartHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: RamModel::TITLE);
|
$this->setTitleField(field: RamModel::TITLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class SoftwareHelper extends PartHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: SoftwareModel::TITLE);
|
$this->setTitleField(field: SoftwareModel::TITLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class StorageHelper extends PartHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: StorageModel::TITLE);
|
$this->setTitleField(field: StorageModel::TITLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class ServerHelper extends EquipmentHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: ServerModel::TITLE);
|
$this->setTitleField(field: ServerModel::TITLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class HomeHelper extends CommonHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(field: ServicePaymentModel::TITLE);
|
$this->setTitleField(field: ServicePaymentModel::TITLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class MyLogHelper extends CommonHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(MyLogModel::TITLE);
|
$this->setTitleField(MyLogModel::TITLE);
|
||||||
}
|
}
|
||||||
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class UserHelper extends CommonHelper
|
|||||||
protected ?IncomingRequest $request = null;
|
protected ?IncomingRequest $request = null;
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->setTitleField(UserModel::TITLE);
|
$this->setTitleField(UserModel::TITLE);
|
||||||
}
|
}
|
||||||
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
||||||
|
|||||||
@ -14,7 +14,7 @@ abstract class AuthService extends CommonService
|
|||||||
private $url_stack_name = "url_stack";
|
private $url_stack_name = "url_stack";
|
||||||
protected function __construct(?IncomingRequest $request = null)
|
protected function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Auth');
|
$this->addClassName('Auth');
|
||||||
}
|
}
|
||||||
abstract public function login(array $formDatas): UserEntity;
|
abstract public function login(array $formDatas): UserEntity;
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class GoogleService extends AuthService
|
|||||||
public function __construct(mixed $mySocket, ?IncomingRequest $request = null)
|
public function __construct(mixed $mySocket, ?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
$this->_mySocket = $mySocket;
|
$this->_mySocket = $mySocket;
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Google');
|
$this->addClassName('Google');
|
||||||
}
|
}
|
||||||
public function getMySocket(): mixed
|
public function getMySocket(): mixed
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class LocalService extends AuthService
|
|||||||
{
|
{
|
||||||
public function __construct(?IncomingRequest $request = null)
|
public function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Local');
|
$this->addClassName('Local');
|
||||||
}
|
}
|
||||||
final public function getModelClass(): UserModel
|
final public function getModelClass(): UserModel
|
||||||
|
|||||||
@ -11,11 +11,7 @@ abstract class CommonService
|
|||||||
private $_model = null;
|
private $_model = null;
|
||||||
private $_classNames = [];
|
private $_classNames = [];
|
||||||
private $_myAuth = null;
|
private $_myAuth = null;
|
||||||
private $_request = null;
|
protected function __construct() {}
|
||||||
protected function __construct(mixed $_request = null)
|
|
||||||
{
|
|
||||||
$this->_request = $_request;
|
|
||||||
}
|
|
||||||
abstract public function getModelClass(): mixed;
|
abstract public function getModelClass(): mixed;
|
||||||
abstract public function getEntityClass(): mixed;
|
abstract public function getEntityClass(): mixed;
|
||||||
abstract public function getFormFields(): array;
|
abstract public function getFormFields(): array;
|
||||||
@ -28,10 +24,6 @@ abstract class CommonService
|
|||||||
}
|
}
|
||||||
return $this->_myAuth;
|
return $this->_myAuth;
|
||||||
}
|
}
|
||||||
final public function getRequest(): mixed
|
|
||||||
{
|
|
||||||
return $this->_request;
|
|
||||||
}
|
|
||||||
public function getIndexFields(): array
|
public function getIndexFields(): array
|
||||||
{
|
{
|
||||||
return $this->getFormFields();
|
return $this->getFormFields();
|
||||||
|
|||||||
@ -8,9 +8,9 @@ use App\Entities\Customer\ClientEntity;
|
|||||||
|
|
||||||
class AccountService extends CustomerService
|
class AccountService extends CustomerService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Account');
|
$this->addClassName('Account');
|
||||||
}
|
}
|
||||||
public function getModelClass(): AccountModel
|
public function getModelClass(): AccountModel
|
||||||
|
|||||||
@ -7,9 +7,9 @@ use App\Models\Customer\ClientModel;
|
|||||||
|
|
||||||
class ClientService extends CustomerService
|
class ClientService extends CustomerService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Client');
|
$this->addClassName('Client');
|
||||||
}
|
}
|
||||||
public function getModelClass(): ClientModel
|
public function getModelClass(): ClientModel
|
||||||
|
|||||||
@ -8,9 +8,9 @@ use App\Entities\Customer\ClientEntity;
|
|||||||
|
|
||||||
class CouponService extends CustomerService
|
class CouponService extends CustomerService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Coupon');
|
$this->addClassName('Coupon');
|
||||||
}
|
}
|
||||||
public function getModelClass(): CouponModel
|
public function getModelClass(): CouponModel
|
||||||
|
|||||||
@ -20,15 +20,15 @@ abstract class CustomerService extends CommonService
|
|||||||
{
|
{
|
||||||
private ?ClientService $_clientService = null;
|
private ?ClientService $_clientService = null;
|
||||||
private $_equipmentService = [];
|
private $_equipmentService = [];
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Customer');
|
$this->addClassName('Customer');
|
||||||
}
|
}
|
||||||
final public function getClientService(): ClientService
|
final public function getClientService(): ClientService
|
||||||
{
|
{
|
||||||
if (!$this->_clientService) {
|
if (!$this->_clientService) {
|
||||||
$this->_clientService = new ClientService($this->request);
|
$this->_clientService = new ClientService();
|
||||||
}
|
}
|
||||||
return $this->_clientService;
|
return $this->_clientService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,9 +8,9 @@ use App\Entities\Customer\ClientEntity;
|
|||||||
|
|
||||||
class PointService extends CustomerService
|
class PointService extends CustomerService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Point');
|
$this->addClassName('Point');
|
||||||
}
|
}
|
||||||
public function getModelClass(): PointModel
|
public function getModelClass(): PointModel
|
||||||
|
|||||||
@ -9,9 +9,9 @@ use App\Services\Customer\ServiceService;
|
|||||||
class ServiceHistoryService extends CustomerService
|
class ServiceHistoryService extends CustomerService
|
||||||
{
|
{
|
||||||
private ?ServiceService $_serviceService = null;
|
private ?ServiceService $_serviceService = null;
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('ServiceHistory');
|
$this->addClassName('ServiceHistory');
|
||||||
}
|
}
|
||||||
public function getModelClass(): ServiceHistoryModel
|
public function getModelClass(): ServiceHistoryModel
|
||||||
@ -25,7 +25,7 @@ class ServiceHistoryService extends CustomerService
|
|||||||
public function getServiceService(): ServiceService
|
public function getServiceService(): ServiceService
|
||||||
{
|
{
|
||||||
if (!$this->_serviceService) {
|
if (!$this->_serviceService) {
|
||||||
$this->_serviceService = new ServiceService($this->request);
|
$this->_serviceService = new ServiceService();
|
||||||
}
|
}
|
||||||
return $this->_serviceService;
|
return $this->_serviceService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,18 +3,21 @@
|
|||||||
namespace App\Services\Customer;
|
namespace App\Services\Customer;
|
||||||
|
|
||||||
use App\Entities\Customer\ServiceItemEntity;
|
use App\Entities\Customer\ServiceItemEntity;
|
||||||
|
use App\Entities\Equipment\Part\IpEntity;
|
||||||
use App\Models\Customer\ServiceItemModel;
|
use App\Models\Customer\ServiceItemModel;
|
||||||
use App\Services\Customer\CustomerService;
|
use App\Services\Customer\CustomerService;
|
||||||
use App\Services\Customer\ServicePaymentService;
|
use App\Services\Customer\ServicePaymentService;
|
||||||
use App\Services\Customer\ServiceService;
|
use App\Services\Customer\ServiceService;
|
||||||
|
use App\Services\Equipment\Part\IpService;
|
||||||
|
|
||||||
class ServiceItemService extends CustomerService
|
class ServiceItemService extends CustomerService
|
||||||
{
|
{
|
||||||
private ?ServiceService $_serviceService = null;
|
private ?ServiceService $_serviceService = null;
|
||||||
private ?ServicePaymentService $_servicePaymentService = null;
|
private ?ServicePaymentService $_servicePaymentService = null;
|
||||||
public function __construct(mixed $request = null)
|
private ?IpService $_ipService = null;
|
||||||
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('ServiceItem');
|
$this->addClassName('ServiceItem');
|
||||||
}
|
}
|
||||||
public function getModelClass(): ServiceItemModel
|
public function getModelClass(): ServiceItemModel
|
||||||
@ -28,14 +31,21 @@ class ServiceItemService extends CustomerService
|
|||||||
public function getServiceService(): ServiceService
|
public function getServiceService(): ServiceService
|
||||||
{
|
{
|
||||||
if (!$this->_serviceService) {
|
if (!$this->_serviceService) {
|
||||||
$this->_serviceService = new ServiceService($this->request);
|
$this->_serviceService = new ServiceService();
|
||||||
}
|
}
|
||||||
return $this->_serviceService;
|
return $this->_serviceService;
|
||||||
}
|
}
|
||||||
|
public function getIpService(): IpService
|
||||||
|
{
|
||||||
|
if (!$this->_ipService) {
|
||||||
|
$this->_ipService = new IpService();
|
||||||
|
}
|
||||||
|
return $this->_ipService;
|
||||||
|
}
|
||||||
public function getServicePaymentService(): ServicePaymentService
|
public function getServicePaymentService(): ServicePaymentService
|
||||||
{
|
{
|
||||||
if (!$this->_servicePaymentService) {
|
if (!$this->_servicePaymentService) {
|
||||||
$this->_servicePaymentService = new ServicePaymentService($this->request);
|
$this->_servicePaymentService = new ServicePaymentService();
|
||||||
}
|
}
|
||||||
return $this->_servicePaymentService;
|
return $this->_servicePaymentService;
|
||||||
}
|
}
|
||||||
@ -80,9 +90,27 @@ class ServiceItemService extends CustomerService
|
|||||||
}
|
}
|
||||||
public function create(array $formDatas, mixed $entity = null): ServiceItemEntity
|
public function create(array $formDatas, mixed $entity = null): ServiceItemEntity
|
||||||
{
|
{
|
||||||
$entity = parent::create($formDatas, $entity);
|
|
||||||
//결제정보 ServicePaymentService에 등록
|
//결제정보 ServicePaymentService에 등록
|
||||||
$this->getServicePaymentService()->createByServiceItem($entity);
|
$this->getServicePaymentService()->createByServiceItem($entity);
|
||||||
return $entity;
|
return parent::create($formDatas, $entity);
|
||||||
|
}
|
||||||
|
public function modify(mixed $entity, array $formDatas): ServiceItemEntity
|
||||||
|
{
|
||||||
|
//IP가 기존과 다를경우 //toggle,batchjob의 경우 $formDatas에 code가 없을수도 있음
|
||||||
|
if (array_key_exists('item_type', $formDatas) && $formDatas['item_type'] !== 'IP') {
|
||||||
|
//기존 IP의 경우 반환처리
|
||||||
|
$this->getIpService()->setStatus($entity->getItemUID(), IpEntity::STATUS_AVAILABLE);
|
||||||
|
//신규 설정된 IP의 경우 서비스중 변경처리
|
||||||
|
$this->getIpService()->setStatus($formDatas['item_uid'], IpEntity::STATUS_OCCUPIED);
|
||||||
|
}
|
||||||
|
return parent::modify($entity, $formDatas);
|
||||||
|
}
|
||||||
|
public function delete(mixed $entity): ServiceItemEntity
|
||||||
|
{
|
||||||
|
//기존 Ip의 경우 반환처리
|
||||||
|
if ($entity->getItemType() === 'IP') {
|
||||||
|
$this->getIpService()->setStatus($entity->getItemUID(), IpEntity::STATUS_AVAILABLE);
|
||||||
|
}
|
||||||
|
return parent::delete($entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,9 +13,9 @@ class ServicePaymentService extends CustomerService
|
|||||||
{
|
{
|
||||||
private ?UserService $_userService = null;
|
private ?UserService $_userService = null;
|
||||||
private ?ServiceService $_serviceService = null;
|
private ?ServiceService $_serviceService = null;
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('ServicePayment');
|
$this->addClassName('ServicePayment');
|
||||||
}
|
}
|
||||||
public function getModelClass(): ServicePaymentModel
|
public function getModelClass(): ServicePaymentModel
|
||||||
@ -55,14 +55,14 @@ class ServicePaymentService extends CustomerService
|
|||||||
public function getUSerService(): UserService
|
public function getUSerService(): UserService
|
||||||
{
|
{
|
||||||
if (!$this->_userService) {
|
if (!$this->_userService) {
|
||||||
$this->_userService = new UserService($this->request);
|
$this->_userService = new UserService();
|
||||||
}
|
}
|
||||||
return $this->_userService;
|
return $this->_userService;
|
||||||
}
|
}
|
||||||
public function getServiceService(): ServiceService
|
public function getServiceService(): ServiceService
|
||||||
{
|
{
|
||||||
if (!$this->_serviceService) {
|
if (!$this->_serviceService) {
|
||||||
$this->_serviceService = new ServiceService($this->request);
|
$this->_serviceService = new ServiceService();
|
||||||
}
|
}
|
||||||
return $this->_serviceService;
|
return $this->_serviceService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,6 @@ use App\Entities\Equipment\Part\IpEntity;
|
|||||||
use App\Models\Customer\ServiceModel;
|
use App\Models\Customer\ServiceModel;
|
||||||
use App\Services\Customer\ServiceItemService;
|
use App\Services\Customer\ServiceItemService;
|
||||||
use App\Services\Equipment\CodeService;
|
use App\Services\Equipment\CodeService;
|
||||||
use App\Services\Equipment\Part\IpService;
|
|
||||||
use App\Services\UserService;
|
use App\Services\UserService;
|
||||||
|
|
||||||
class ServiceService extends CustomerService
|
class ServiceService extends CustomerService
|
||||||
@ -18,11 +17,10 @@ class ServiceService extends CustomerService
|
|||||||
private ?CodeService $_codeService = null;
|
private ?CodeService $_codeService = null;
|
||||||
private ?ServiceItemService $_serviceItemService = null;
|
private ?ServiceItemService $_serviceItemService = null;
|
||||||
private ?ServicePaymentService $_servicePaymentService = null;
|
private ?ServicePaymentService $_servicePaymentService = null;
|
||||||
private ?IpService $_ipService = null;
|
|
||||||
private ?string $_searchIP = null;
|
private ?string $_searchIP = null;
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Service');
|
$this->addClassName('Service');
|
||||||
}
|
}
|
||||||
public function getModelClass(): ServiceModel
|
public function getModelClass(): ServiceModel
|
||||||
@ -63,35 +61,28 @@ class ServiceService extends CustomerService
|
|||||||
public function getUSerService(): UserService
|
public function getUSerService(): UserService
|
||||||
{
|
{
|
||||||
if (!$this->_userService) {
|
if (!$this->_userService) {
|
||||||
$this->_userService = new UserService($this->request);
|
$this->_userService = new UserService();
|
||||||
}
|
}
|
||||||
return $this->_userService;
|
return $this->_userService;
|
||||||
}
|
}
|
||||||
public function getCodeService(): CodeService
|
public function getCodeService(): CodeService
|
||||||
{
|
{
|
||||||
if (!$this->_codeService) {
|
if (!$this->_codeService) {
|
||||||
$this->_codeService = new CodeService($this->request);
|
$this->_codeService = new CodeService();
|
||||||
}
|
}
|
||||||
return $this->_codeService;
|
return $this->_codeService;
|
||||||
}
|
}
|
||||||
public function getServiceItemService(): ServiceItemService
|
public function getServiceItemService(): ServiceItemService
|
||||||
{
|
{
|
||||||
if (!$this->_serviceItemService) {
|
if (!$this->_serviceItemService) {
|
||||||
$this->_serviceItemService = new ServiceItemService($this->request);
|
$this->_serviceItemService = new ServiceItemService();
|
||||||
}
|
}
|
||||||
return $this->_serviceItemService;
|
return $this->_serviceItemService;
|
||||||
}
|
}
|
||||||
public function getIpService(): IpService
|
|
||||||
{
|
|
||||||
if (!$this->_ipService) {
|
|
||||||
$this->_ipService = new IpService($this->request);
|
|
||||||
}
|
|
||||||
return $this->_ipService;
|
|
||||||
}
|
|
||||||
public function getServicePaymentService(): ServicePaymentService
|
public function getServicePaymentService(): ServicePaymentService
|
||||||
{
|
{
|
||||||
if (!$this->_servicePaymentService) {
|
if (!$this->_servicePaymentService) {
|
||||||
$this->_servicePaymentService = new ServicePaymentService($this->request);
|
$this->_servicePaymentService = new ServicePaymentService();
|
||||||
}
|
}
|
||||||
return $this->_servicePaymentService;
|
return $this->_servicePaymentService;
|
||||||
}
|
}
|
||||||
@ -223,9 +214,11 @@ class ServiceService extends CustomerService
|
|||||||
{
|
{
|
||||||
//기존 code의 경우 반환처리
|
//기존 code의 경우 반환처리
|
||||||
$this->getCodeService()->setStatus($entity->getCode(), CodeEntity::STATUS_AVAILABLE);
|
$this->getCodeService()->setStatus($entity->getCode(), CodeEntity::STATUS_AVAILABLE);
|
||||||
//IP의 경우 반환 처리
|
//Item들 삭제
|
||||||
foreach ($entity->getItemEntities("IP") as $itemEntity) {
|
foreach (SERVICE_ITEM_TYPES as $item_type => $label) {
|
||||||
$this->getIpService()->setStatus($itemEntity->getItemUID(), IpEntity::STATUS_AVAILABLE);
|
foreach ($entity->getItemEntities($item_type) as $itemEntity) {
|
||||||
|
$this->getServiceItemService()->delete($itemEntity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return parent::delete($entity);
|
return parent::delete($entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,9 +8,9 @@ use App\Services\Equipment\EquipmentService;
|
|||||||
|
|
||||||
class CodeService extends EquipmentService
|
class CodeService extends EquipmentService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Code');
|
$this->addClassName('Code');
|
||||||
}
|
}
|
||||||
public function getModelClass(): CodeModel
|
public function getModelClass(): CodeModel
|
||||||
|
|||||||
@ -7,9 +7,9 @@ use App\Models\Equipment\DomainModel;
|
|||||||
|
|
||||||
class DomainService extends EquipmentService
|
class DomainService extends EquipmentService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Domain');
|
$this->addClassName('Domain');
|
||||||
}
|
}
|
||||||
public function getModelClass(): DomainModel
|
public function getModelClass(): DomainModel
|
||||||
|
|||||||
@ -8,16 +8,16 @@ use App\Services\Customer\ClientService;
|
|||||||
abstract class EquipmentService extends CommonService
|
abstract class EquipmentService extends CommonService
|
||||||
{
|
{
|
||||||
private ?ClientService $_clientService = null;
|
private ?ClientService $_clientService = null;
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Equipment');
|
$this->addClassName('Equipment');
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getClientService(): ClientService
|
final public function getClientService(): ClientService
|
||||||
{
|
{
|
||||||
if (!$this->_clientService) {
|
if (!$this->_clientService) {
|
||||||
$this->_clientService = new ClientService($this->request);
|
$this->_clientService = new ClientService();
|
||||||
}
|
}
|
||||||
return $this->_clientService;
|
return $this->_clientService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,9 +7,9 @@ use App\Models\Equipment\Part\CpuModel;
|
|||||||
|
|
||||||
class CpuService extends PartService
|
class CpuService extends PartService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Cpu');
|
$this->addClassName('Cpu');
|
||||||
}
|
}
|
||||||
public function getModelClass(): CpuModel
|
public function getModelClass(): CpuModel
|
||||||
|
|||||||
@ -7,9 +7,9 @@ use App\Models\Equipment\Part\DefenceModel;
|
|||||||
|
|
||||||
class DefenceService extends PartService
|
class DefenceService extends PartService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Defence');
|
$this->addClassName('Defence');
|
||||||
}
|
}
|
||||||
public function getModelClass(): DefenceModel
|
public function getModelClass(): DefenceModel
|
||||||
|
|||||||
@ -10,9 +10,9 @@ use App\Services\Equipment\Part\LineService;
|
|||||||
class IpService extends PartService
|
class IpService extends PartService
|
||||||
{
|
{
|
||||||
private ?LineService $_lineService = null;
|
private ?LineService $_lineService = null;
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Ip');
|
$this->addClassName('Ip');
|
||||||
}
|
}
|
||||||
public function getModelClass(): IpModel
|
public function getModelClass(): IpModel
|
||||||
@ -46,7 +46,7 @@ class IpService extends PartService
|
|||||||
final public function getLineService(): LineService
|
final public function getLineService(): LineService
|
||||||
{
|
{
|
||||||
if (!$this->_lineService) {
|
if (!$this->_lineService) {
|
||||||
$this->_lineService = new LineService($this->request);
|
$this->_lineService = new LineService();
|
||||||
}
|
}
|
||||||
return $this->_lineService;
|
return $this->_lineService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,9 +7,9 @@ use App\Models\Equipment\Part\LineModel;
|
|||||||
|
|
||||||
class LineService extends PartService
|
class LineService extends PartService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Line');
|
$this->addClassName('Line');
|
||||||
}
|
}
|
||||||
public function getModelClass(): LineModel
|
public function getModelClass(): LineModel
|
||||||
|
|||||||
@ -6,9 +6,9 @@ use App\Services\Equipment\EquipmentService;
|
|||||||
|
|
||||||
abstract class PartService extends EquipmentService
|
abstract class PartService extends EquipmentService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Part');
|
$this->addClassName('Part');
|
||||||
}
|
}
|
||||||
//FieldForm관련용
|
//FieldForm관련용
|
||||||
|
|||||||
@ -7,9 +7,9 @@ use App\Models\Equipment\Part\RamModel;
|
|||||||
|
|
||||||
class RamService extends PartService
|
class RamService extends PartService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Ram');
|
$this->addClassName('Ram');
|
||||||
}
|
}
|
||||||
public function getModelClass(): RamModel
|
public function getModelClass(): RamModel
|
||||||
|
|||||||
@ -7,9 +7,9 @@ use App\Models\Equipment\Part\SoftwareModel;
|
|||||||
|
|
||||||
class SoftwareService extends PartService
|
class SoftwareService extends PartService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Software');
|
$this->addClassName('Software');
|
||||||
}
|
}
|
||||||
public function getModelClass(): SoftwareModel
|
public function getModelClass(): SoftwareModel
|
||||||
|
|||||||
@ -7,9 +7,9 @@ use App\Models\Equipment\Part\StorageModel;
|
|||||||
|
|
||||||
class StorageService extends PartService
|
class StorageService extends PartService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Storage');
|
$this->addClassName('Storage');
|
||||||
}
|
}
|
||||||
public function getModelClass(): StorageModel
|
public function getModelClass(): StorageModel
|
||||||
|
|||||||
@ -8,9 +8,9 @@ use App\Services\Equipment\EquipmentService;
|
|||||||
|
|
||||||
class ServerService extends EquipmentService
|
class ServerService extends EquipmentService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('Server');
|
$this->addClassName('Server');
|
||||||
}
|
}
|
||||||
public function getModelClass(): ServerModel
|
public function getModelClass(): ServerModel
|
||||||
|
|||||||
@ -11,9 +11,9 @@ use App\Services\UserService;
|
|||||||
class MyLogService extends CommonService
|
class MyLogService extends CommonService
|
||||||
{
|
{
|
||||||
private $_userService = null;
|
private $_userService = null;
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('MyLog');
|
$this->addClassName('MyLog');
|
||||||
}
|
}
|
||||||
public function getModelClass(): MyLogModel
|
public function getModelClass(): MyLogModel
|
||||||
@ -51,7 +51,7 @@ class MyLogService extends CommonService
|
|||||||
public function getUserService(): UserService
|
public function getUserService(): UserService
|
||||||
{
|
{
|
||||||
if (!$this->_userService) {
|
if (!$this->_userService) {
|
||||||
$this->_userService = new UserService($this->request);
|
$this->_userService = new UserService();
|
||||||
}
|
}
|
||||||
return $this->_userService;
|
return $this->_userService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,9 +8,9 @@ use App\Entities\UserSNSEntity;
|
|||||||
|
|
||||||
class UserSNSService extends CommonService
|
class UserSNSService extends CommonService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);;
|
parent::__construct();;
|
||||||
$this->addClassName('UserSNS');
|
$this->addClassName('UserSNS');
|
||||||
}
|
}
|
||||||
public function getModelClass(): UserSNSModel
|
public function getModelClass(): UserSNSModel
|
||||||
|
|||||||
@ -7,9 +7,9 @@ use App\Models\UserModel;
|
|||||||
|
|
||||||
class UserService extends CommonService
|
class UserService extends CommonService
|
||||||
{
|
{
|
||||||
public function __construct(mixed $request = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct();
|
||||||
$this->addClassName('User');
|
$this->addClassName('User');
|
||||||
}
|
}
|
||||||
public function getModelClass(): UserModel
|
public function getModelClass(): UserModel
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user