| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace MGModule\DNSManager2\mgLibs\custom\dns\submodules\OpenProvider\Adapters;
- use MGModule\DNSManager2\mgLibs\custom\dns\record\Record;
- use MGModule\DNSManager2\mgLibs\custom\dns\submodules\OpenProvider\OPRecordAdapterType;
- class TXTAdapter extends Record
- {
- /**
- * TXTAdapter constructor.
- * @param Record $record
- */
- public function __construct( Record $record)
- {
- $this->line = $record->line;
- $this->name = $record->name;
- $this->type = 'TXT';
- $this->class = $record->class;
- $this->ttl = $record->ttl;
- $this->rdlength = $record->rdlength;
- $this->rdata = new OPRecordAdapterType();
- $this->rdata->txtdata = str_replace('"', "", htmlspecialchars_decode($record->rdata->txtdata));
- $this->absoluteName = $record->absoluteName;
- $this->customData = $record->customData;
- }
- public function toDnsManagerRecord($record)
- {
- $templateData = [
- 'name' => $record['name'],
- 'type' => $record['type'],
- 'ttl' => $record['ttl'],
- 'txtdata' => str_replace('"', "", $record['value']),
- ];
- return Record::tryToCreateFromArray($templateData);
- }
- }
|