public function setDomain(eppDomain $domain)
 {
     if (!strlen($domain->getDomainname())) {
         throw new eppException('eppDeleteRequest domain object does not contain a valid domain name');
     }
     #
     # Object delete structure
     #
     $this->domainobject->appendChild($this->createElement('domain:name', $domain->getDomainname()));
 }
 public function setDomain(eppDomain $domain)
 {
     if (!strlen($domain->getDomainname())) {
         throw new eppException('eppUndeleteRequest domain object does not contain a valid domain name');
     }
     #
     # Object delete structure
     #
     $commandext = $this->createElement('ext:command');
     $undelete = $this->createElement('ext:undelete');
     $undelete->appendChild($this->createElement('domain:name', $domain->getDomainname()));
     $commandext->appendChild($undelete);
     $this->getExtension()->appendChild($commandext);
 }
 function __construct(eppDomain $domain, $clientdelete)
 {
     $upd = new eppDomain($domain->getDomainname());
     parent::__construct($domain, null, null, $upd);
     $this->setClientDelete($clientdelete);
     parent::addSessionId();
 }
 function __construct(eppDomain $domain, $addinfo = null, $removeinfo = null, $updateinfo = null, $forcehostattr = false)
 {
     $upd = new eppDomain($domain->getDomainname());
     parent::__construct($domain, null, null, $upd);
     $this->addTrustee();
     parent::addSessionId();
 }
 /**
  *
  * @param eppDomain $domain
  * @return \DOMElement
  * @throws eppException
  */
 public function setDomain(eppDomain $domain)
 {
     if (!strlen($domain->getDomainname())) {
         throw new eppException('No valid domain name in create domain request');
     }
     if (!strlen($domain->getRegistrant())) {
         throw new eppException('No valid registrant in create domain request');
     }
     #
     # Object create structure
     #
     $this->domainobject->appendChild($this->createElement('domain:name', $domain->getDomainname()));
     if ($domain->getPeriod() > 0) {
         $domainperiod = $this->createElement('domain:period', $domain->getPeriod());
         $domainperiod->setAttribute('unit', $domain->getPeriodUnit());
         $this->domainobject->appendChild($domainperiod);
     }
     $nsobjects = $domain->getHosts();
     if ($domain->getHostLength() > 0) {
         $nameservers = $this->createElement('domain:ns');
         foreach ($nsobjects as $nsobject) {
             /* @var $nsobject eppHost */
             if ($this->getForcehostattr() || $nsobject->getIpAddressCount() > 0) {
                 $nameservers->appendChild($this->addDomainHostAttr($nsobject));
             } else {
                 $nameservers->appendChild($this->addDomainHostObj($nsobject));
             }
         }
         $this->domainobject->appendChild($nameservers);
     }
     $this->domainobject->appendChild($this->createElement('domain:registrant', $domain->getRegistrant()));
     $contacts = $domain->getContacts();
     if ($domain->getContactLength() > 0) {
         foreach ($contacts as $contact) {
             /* @var $contact eppContactHandle */
             $this->addDomainContact($this->domainobject, $contact->getContactHandle(), $contact->getContactType());
         }
     }
     if (strlen($domain->getAuthorisationCode())) {
         $authinfo = $this->createElement('domain:authInfo');
         $authinfo->appendChild($this->createElement('domain:pw', $domain->getAuthorisationCode()));
         $this->domainobject->appendChild($authinfo);
     }
     // Check for DNSSEC keys and add them
     if ($domain->getSecdnsLength() > 0) {
         for ($i = 0; $i < $domain->getSecdnsLength(); $i++) {
             $sd = $domain->getSecdns($i);
             /* @var $sd eppSecdns */
             if ($sd) {
                 $ext = new eppSecdns();
                 $ext->copy($sd);
                 $this->addSecdns($ext);
             }
         }
     }
     return;
 }
 public function setDomain(eppDomain $domain, $hosts = null)
 {
     if (!strlen($domain->getDomainname())) {
         throw new eppException('Domain object does not contain a valid domain name');
     }
     #
     # Domain structure
     #
     $dname = $this->createElement('domain:name', $domain->getDomainname());
     if ($hosts) {
         if ($hosts == self::HOSTS_ALL || $hosts == self::HOSTS_DELEGATED || $hosts == self::HOSTS_NONE || $hosts == self::HOSTS_SUBORDINATE) {
             $dname->setAttribute('hosts', $hosts);
         } else {
             throw new eppException('Hosts parameter of inforequest can only be to be all, none, del or sub');
         }
     }
     $this->domainobject->appendChild($dname);
     if (!is_null($domain->getAuthorisationCode())) {
         $authinfo = $this->createElement('domain:authInfo');
         $authinfo->appendChild($this->createElement('domain:pw', $domain->getAuthorisationCode()));
         $this->domainobject->appendChild($authinfo);
     }
 }
 public function setDomain(eppDomain $domain, $expdate = null)
 {
     #
     # Object create structure
     #
     $this->domainobject->appendChild($this->createElement('domain:name', $domain->getDomainname()));
     if ($expdate) {
         $this->domainobject->appendChild($this->createElement('domain:curExpDate', $expdate));
     }
     if ($domain->getPeriod() > 0) {
         $domainperiod = $this->createElement('domain:period', $domain->getPeriod());
         $domainperiod->setAttribute('unit', $domain->getPeriodUnit());
         $this->domainobject->appendChild($domainperiod);
     }
 }
 /**
  * eppRgpRestoreRequest constructor.
  * @param eppDomain      $objectname
  * @param eppDomain|null $addinfo
  * @param eppDomain|null $removeinfo
  * @param eppDomain|null $updateinfo
  */
 public function __construct(eppDomain $objectname, $addinfo = null, $removeinfo = null, $updateinfo = null)
 {
     if ($objectname instanceof eppDomain) {
         $domainname = $objectname->getDomainname();
     } else {
         $domainname = $objectname;
     }
     if ($updateinfo == null) {
         $updateinfo = new eppDomain($domainname);
     }
     parent::__construct($domainname, null, null, $updateinfo);
     $rgp = $this->createElement('rgp:update');
     //$this->addExtension('xmlns:rgp', 'urn:ietf:params:xml:ns:rgp-1.0');
     $restore = $this->createElement('rgp:restore');
     $restore->setAttribute('op', 'request');
     $rgp->appendChild($restore);
     $this->getExtension()->appendChild($rgp);
     $this->addSessionId();
 }
 public function setDomainRequest(eppDomain $domain)
 {
     #
     # Object create structure
     #
     $transfer = $this->createElement('transfer');
     $transfer->setAttribute('op', self::OPERATION_REQUEST);
     $this->domainobject = $this->createElement('domain:transfer');
     $this->domainobject->appendChild($this->createElement('domain:name', $domain->getDomainname()));
     if ($domain->getPeriod()) {
         $domainperiod = $this->createElement('domain:period', $domain->getPeriod());
         $domainperiod->setAttribute('unit', eppDomain::DOMAIN_PERIOD_UNIT_Y);
         $this->domainobject->appendChild($domainperiod);
     }
     if (strlen($domain->getAuthorisationCode())) {
         $authinfo = $this->createElement('domain:authInfo');
         $authinfo->appendChild($this->createElement('domain:pw', $domain->getAuthorisationCode()));
         $this->domainobject->appendChild($authinfo);
     }
     $transfer->appendChild($this->domainobject);
     $this->getCommand()->appendChild($transfer);
 }