-
Notifications
You must be signed in to change notification settings - Fork 2
/
Record.php
49 lines (40 loc) · 1.19 KB
/
Record.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php declare(strict_types=1);
/**
* Copyright (C) Apis Networks, Inc - All Rights Reserved.
*
* Unauthorized copying of this file, via any medium, is
* strictly prohibited without consent. Any dissemination of
* material herein is prohibited.
*
* For licensing inquiries email <[email protected]>
*
* Written by Matt Saladna <[email protected]>, March 2019
*/
namespace Opcenter\Dns\Providers\Digitalocean;
class Record extends \Opcenter\Dns\Record
{
protected $ttl = Module::DNS_TTL;
protected function formatCaa() {
// normalize target without quotes, period
$this->setMeta('data', trim($this->getMeta('data'), '".'));
$this->appendDot();
}
protected function formatCname() {
return $this->appendDot();
}
protected function formatNs() {
return $this->appendDot();
}
protected function formatMx() {
return $this->appendDot();
}
protected function formatSrv() {
return $this->appendDot();
}
private function appendDot() {
if (null !== ($data = $this->getMeta('data'))) {
$this->setMeta('data', rtrim($data, '.') . '.');
}
$this->parameter = $this->parameter ? rtrim($this->parameter, '.') . '.' : null;
}
}