Conditions | 5 |
Paths | 4 |
Total Lines | 28 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
37 | public function payload($changetype = null) |
||
38 | { |
||
39 | $rrset = [ |
||
40 | 'name' => Helper::canonical($this->name), |
||
41 | 'type' => Helper::className($this), |
||
42 | ]; |
||
43 | |||
44 | if ($changetype !== null && $changetype === 'DELETE') { |
||
45 | $rrset['records'] = []; |
||
46 | } else { |
||
47 | $records = []; |
||
48 | foreach ($this->content as $record) { |
||
49 | $records[] = [ |
||
50 | 'content' => $record, |
||
51 | 'disabled' => false, |
||
52 | ]; |
||
53 | } |
||
54 | |||
55 | $rrset['ttl'] = $this->ttl; |
||
56 | $rrset['records'] = $records; |
||
57 | } |
||
58 | |||
59 | if ($changetype !== null) { |
||
60 | $rrset['changetype'] = $changetype; |
||
61 | } |
||
62 | |||
63 | return $rrset; |
||
64 | } |
||
65 | } |
||
66 |