44 lines
1.4 KiB
PHP
44 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Libraries\MySocket\Cloudflare;
|
|
|
|
use App\Libraries\MySocket\CloudflareSocket;
|
|
use App\Models\Cloudflare\AccountModel;
|
|
|
|
class AccountSocket extends CloudflareSocket
|
|
{
|
|
public function __construct(string $email, string $auth_key)
|
|
{
|
|
parent::__construct();
|
|
$this->setAdapter($email, $auth_key);
|
|
}
|
|
//Result 형태
|
|
// [
|
|
// {"id":"078e88a7735965b661715af13031ecb0",
|
|
// "name":"Cloudwin002@idcjp.jp's Auth",
|
|
// "type":"standard",
|
|
// "settings":{
|
|
// "enforce_twofactor":false,
|
|
// "api_access_enabled":null,
|
|
// "access_approval_expiry":null,
|
|
// "use_account_custom_ns_by_default":false
|
|
// },
|
|
// "legacy_flags":{"enterprise_zone_quota":{"maximum":0,"current":0,"available":0}},
|
|
// "created_on":"2017-06-26T05:44:49.470184Z"}
|
|
// ]
|
|
public function getArrayByResult($result, array $formDatas = []): array
|
|
{
|
|
$formDatas[AccountModel::PK] = $result->id;
|
|
$formDatas[AccountModel::TITLE] = $result->name;
|
|
$formDatas['type'] = $result->type;
|
|
$formDatas['status'] = 'use';
|
|
$formDatas['updated_at'] = date("Y-m-d H:i:s");
|
|
$formDatas['created_at'] = $result->created_on;
|
|
return $formDatas;
|
|
}
|
|
public function create(): array
|
|
{
|
|
return $this->reload_procedure('accounts');
|
|
}
|
|
}
|