Completed
Pull Request — master (#67)
by
unknown
01:19
created

Domain::setBook()   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
13
    protected $extension_xmlns = 'http://www.dns.pl/nask-epp-schema/extdom-2.0';
14
15
    public function getExtensionNamespace()
16
    {
17
        return $this->extension_xmlns;
18
    }
19
20
    public function setBook()
21
    {
22
        $this->set('//epp:epp/epp:command/epp:extension/extdom:create/extdom:book');
23
    }
24
25
    public function addNs($host)
26
    {
27
        if (!Validator::isHostname($host)) {
28
            throw new \Exception(sprintf('%s is not a valid host name', $host));
29
        }
30
31
        $this->set('domain:ns[]', $host);
32
    }
33
34
    public function addHostObj($host)
35
    {
36
        return $this->addNs($host);
37
    }
38
39
    public function setAdminContact($admin_contact)
40
    {
41
        return false; //TODO: should this throw if registry doesn't allow Admin contact?
42
    }
43
44
    public function setTechContact($tech_contact)
45
    {
46
        return false; //TODO: should this throw if registry doesn't allow Tech contact?
47
    }
48
49
    public function setBillingContact($billing_contact)
50
    {
51
        return false; //TODO: should this throw if registry doesn't allow Billing contact?
52
    }
53
}
54