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); } }