protected function addDomainChanges($element, eppDomain $domain) { if ($domain->getRegistrant()) { $element->appendChild($this->createElement('domain:registrant', $domain->getRegistrant())); } $hosts = $domain->getHosts(); if (is_array($hosts) && count($hosts)) { $nameservers = $this->createElement('domain:ns'); foreach ($hosts as $host) { /* @var eppHost $host */ if ($this->getForcehostattr() || is_array($host->getIpAddresses())) { $nameservers->appendChild($this->addDomainHostAttr($host)); } else { $nameservers->appendChild($this->addDomainHostObj($host)); } } $element->appendChild($nameservers); } $contacts = $domain->getContacts(); if (is_array($contacts)) { foreach ($contacts as $contact) { /* @var eppContactHandle $contact */ $this->addDomainContact($element, $contact->getContactHandle(), $contact->getContactType()); } } $statuses = $domain->getStatuses(); if (is_array($statuses)) { foreach ($statuses as $status) { $this->addDomainStatus($element, $status); } } if (strlen($domain->getAuthorisationCode())) { $authinfo = $this->createElement('domain:authInfo'); $pw = $this->createElement('domain:pw'); $pw->appendChild($this->createCDATASection($domain->getAuthorisationCode())); $authinfo->appendChild($pw); $element->appendChild($authinfo); } }