cfmgrv4 init...2

This commit is contained in:
최준흠 2024-10-12 00:07:14 +09:00
parent f051e0ae11
commit a7ff8e6ebd
3 changed files with 37 additions and 50 deletions

View File

@ -13,7 +13,6 @@ use Psr\Log\LoggerInterface;
class AccountController extends CloudflareController
{
private $_myLibrary = null;
private $_model = null;
private $_auth_entity = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
@ -33,10 +32,7 @@ class AccountController extends CloudflareController
}
final protected function getMyLibrary(): Account
{
if ($this->_myLibrary === null) {
$this->_myLibrary = new Account($this->_auth_entity);
}
return $this->_myLibrary;
return new Account($this->_auth_entity);
}
protected function getFormFieldOption(string $field, array $options = []): array
{

View File

@ -13,7 +13,6 @@ use Psr\Log\LoggerInterface;
class RecordController extends CloudflareController
{
private $_myLibrary = null;
private $_zone_entity = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
@ -32,10 +31,7 @@ class RecordController extends CloudflareController
}
final protected function getMyLibrary(): Record
{
if ($this->_myLibrary === null) {
$this->_myLibrary = new Record($this->_zone_entity);
}
return $this->_myLibrary;
return new Record($this->_zone_entity);
}
protected function getFormFieldOption(string $field, array $options = []): array
{

View File

@ -2,7 +2,6 @@
namespace App\Controllers\Admin\Cloudflare;
use App\Entities\Cloudflare\RecordEntity;
use App\Helpers\Cloudflare\ZoneHelper;
use App\Libraries\Cloudflare\Record;
use App\Libraries\Cloudflare\Zone;
@ -15,7 +14,6 @@ use Psr\Log\LoggerInterface;
class ZoneController extends CloudflareController
{
private $_myLibrary = null;
private $_account_entity = null;
private $_model = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
@ -35,10 +33,7 @@ class ZoneController extends CloudflareController
}
final protected function getMyLibrary(): Zone
{
if ($this->_myLibrary === null) {
$this->_myLibrary = new Zone($this->_account_entity);
}
return $this->_myLibrary;
return new Zone($this->_account_entity);
}
protected function getFormFieldOption(string $field, array $options = []): array
{