update email template
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Integrations\Domain\Writers;
|
||||
|
||||
use App\Integrations\Domain\DTOs\DnsRecordData;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class DnsRecordWriter
|
||||
{
|
||||
/**
|
||||
* Skips records whose domain couldn't be resolved — dns_manager_ns.dns_manager_domain_id is NOT NULL.
|
||||
*/
|
||||
public function write(DnsRecordData $data): bool
|
||||
{
|
||||
if ($data->dnsManagerDomainId === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
DB::table('dns_manager_ns')->updateOrInsert(
|
||||
['legacy_id' => $data->legacyId],
|
||||
[
|
||||
'dns_manager_domain_id' => $data->dnsManagerDomainId,
|
||||
'name' => $data->name,
|
||||
'type' => $data->type,
|
||||
'service_name' => $data->serviceName,
|
||||
'protocol' => $data->protocol,
|
||||
'priority' => $data->priority,
|
||||
'weight' => $data->weight,
|
||||
'port' => $data->port,
|
||||
'value' => $data->value,
|
||||
'plesk_id' => $data->pleskId,
|
||||
'ttl' => $data->ttl,
|
||||
'created_at' => $data->createdAt,
|
||||
'updated_at' => $data->updatedAt,
|
||||
]
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user