cfmgrv4/app/Controllers/Admin/Cloudflare/CloudflareController.php
2024-09-28 15:07:19 +09:00

55 lines
1.6 KiB
PHP

<?php
namespace App\Controllers\Admin\Cloudflare;
use Psr\Log\LoggerInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\HTTP\RequestInterface;
use App\Models\Cloudflare\ZoneModel;
use App\Models\Cloudflare\RecordModel;
use App\Models\Cloudflare\AuthModel;
use App\Models\Cloudflare\AccountModel;
use App\Entities\Cloudflare\AccountEntity;
use App\Controllers\Admin\AdminController;
abstract class CloudflareController extends AdminController
{
private $_authModel = null;
private $_accountModel = null;
private $_zoneModel = null;
private $_recordModel = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->class_path .= "Cloudflare/";
}
final protected function getAuthModel(): AuthModel
{
if ($this->_authModel === null) {
$this->_authModel = new AuthModel();
}
return $this->_authModel;
}
final protected function getAccountModel(): AccountModel
{
if ($this->_accountModel === null) {
$this->_accountModel = new AccountModel();
}
return $this->_accountModel;
}
final protected function getZoneModel(): ZoneModel
{
if ($this->_zoneModel === null) {
$this->_zoneModel = new ZoneModel();
}
return $this->_zoneModel;
}
final protected function getRecordModel(): RecordModel
{
if ($this->_recordModel === null) {
$this->_recordModel = new RecordModel();
}
return $this->_recordModel;
}
}