DNAMEAdapter.php 902 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace MGModule\DNSManager2\mgLibs\custom\dns\submodules\cPanel;
  3. use MGModule\DNSManager2\mgLibs\custom\dns\record\Record;
  4. class DNAMEAdapter extends Record
  5. {
  6. public function __construct( Record $record)
  7. {
  8. $this->line = $record->line;
  9. $this->name = $record->name;
  10. $this->type = 'DNAME';
  11. $this->class = $record->class;
  12. $this->ttl = $record->ttl;
  13. $this->rdlength = $record->rdlength;
  14. $this->rdata = new CpanelRecordAdapterType();
  15. $this->rdata->dname = $record->rdata->target;
  16. $this->absoluteName = $record->absoluteName;
  17. $this->customData = $record->customData;
  18. }
  19. public static function toDnsManagerRecord(array $recordArray)
  20. {
  21. $recordArray['target'] = $recordArray['dname'];
  22. unset($recordArray['dname']);
  23. return Record::tryToCreateFromArray($recordArray);
  24. }
  25. }