dbms/app/Services/Customer/CustomerService.php
2025-05-06 19:08:29 +09:00

48 lines
1.3 KiB
PHP

<?php
namespace App\Services\Customer;
use App\Services\CommonService;
use CodeIgniter\HTTP\IncomingRequest;
use App\Services\Customer\AccountService;
use App\Services\Customer\CouponService;
use App\Services\Customer\PointService;
abstract class CustomerService extends CommonService
{
private ?AccountService $_accountService = null;
private ?CouponService $_couponService = null;
private ?PointService $_pointService = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
}
public function getClassName(): string
{
return "Customer" . DIRECTORY_SEPARATOR;
}
final public function getAccountService(): AccountService
{
if (!$this->_accountService) {
$this->_accountService = new AccountService($this->getRequest());
}
return $this->_accountService;
}
final public function getCouponService(): CouponService
{
if (!$this->_couponService) {
$this->_couponService = new CouponService($this->getRequest());
}
return $this->_couponService;
}
final public function getPointService(): PointService
{
if (!$this->_pointService) {
$this->_pointService = new PointService($this->getRequest());
}
return $this->_pointService;
}
}