Completed
Pull Request — master (#84)
by
unknown
01:35
created

Domain::getExtensionNamespace()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace AfriCC\EPP\Extension\NASK\Create;
4
5
use AfriCC\EPP\ExtensionInterface;
6
use AfriCC\EPP\Frame\Command\Create\Domain as DomainCreate;
7
use AfriCC\EPP\Validator;
8
9
class Domain extends DomainCreate implements ExtensionInterface
10
{
11
    protected $extension = 'extdom';
12
    protected $extension_xmlns = 'http://www.dns.pl/nask-epp-schema/extdom-2.0';
13
14
    public function setBook()
15
    {
16
        $this->set('//epp:epp/epp:command/epp:extension/extdom:create/extdom:book');
17
    }
18
19
    public function addNs($host)
20
    {
21
        if (!Validator::isHostname($host)) {
22
            throw new \Exception(sprintf('%s is not a valid host name', $host));
23
        }
24
25
        $this->set('domain:ns[]', $host);
26
    }
27
28
    public function addHostObj($host)
29
    {
30
        return $this->addNs($host);
31
    }
32
33
    public function setAdminContact($admin_contact)
34
    {
35
        return false; //TODO: should this throw if registry doesn't allow Admin contact?
36
    }
37
38
    public function setTechContact($tech_contact)
39
    {
40
        return false; //TODO: should this throw if registry doesn't allow Tech contact?
41
    }
42
43
    public function setBillingContact($billing_contact)
44
    {
45
        return false; //TODO: should this throw if registry doesn't allow Billing contact?
46
    }
47
}
48