Metaregistrar\EPP\eppInfoDomainResponse::getDomainNameservers PHP Method

getDomainNameservers() public method

This function returns the associated nameservers from a domain object Please do not confuse this with getDomainHosts(), which is used for subordinate host objects
public getDomainNameservers ( ) : array
return array of strings
    public function getDomainNameservers()
    {
        $xpath = $this->xPath();
        $result = $xpath->query('/epp:epp/epp:response/epp:resData/domain:infData/domain:ns/*');
        if ($result->length > 0) {
            $ns = null;
            foreach ($result as $nameserver) {
                /* @var $nameserver \DOMElement */
                if (strstr($nameserver->tagName, ":hostObj")) {
                    $ns[] = new eppHost(trim($nameserver->nodeValue));
                }
                if (strstr($nameserver->tagName, ":hostAttr")) {
                    $hostname = $nameserver->getElementsByTagName('hostName')->item(0)->nodeValue;
                    $ipaddresses = $nameserver->getElementsByTagName('hostAddr');
                    $ips = null;
                    foreach ($ipaddresses as $ip) {
                        $ips[] = $ip->nodeValue;
                    }
                    $ns[] = new eppHost($hostname, $ips);
                }
            }
            return $ns;
        } else {
            return null;
        }
    }