| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace MGModule\DNSManager2\mgLibs\custom\dns\submodules\cPanel;
- use MGModule\DNSManager2\mgLibs\custom\dns\record\Record;
- class DSAdapter extends Record
- {
- /**
- * DSAdapter constructor.
- * @param Record $record
- */
- public function __construct( Record $record )
- {
- $this->type = 'DS';
- $this->name = $record->name;
- $this->absoluteName = $record->absoluteName;
- $this->ttl = (int)$record->ttl;
- $this->class = $record->class;
- $this->line = $record->line;
- $this->customData = $record->customData;
- $this->rdlength = $record->rdlength;
- $this->rdata = new CpanelRecordAdapterType();
- $this->rdata->keyname = (int)$record->rdata->keytag;
- $this->rdata->digitype = (int)$record->rdata->digesttype;
- $this->rdata->algorithm = (int)$record->rdata->algorithm;
- }
- public static function toDnsManagerRecord(array $recordArray)
- {
- $recordArray['keytag'] = $recordArray['keyname'];
- $recordArray['digesttype'] = $recordArray['digitype'];
- unset($recordArray['keyname'],$recordArray['digitype']);
- return Record::tryToCreateFromArray($recordArray);
- }
- }
|