Completed
Pull Request — master (#84)
by
unknown
01:46
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\ExtensionTrait;
7
use AfriCC\EPP\Frame\Command\Create\Domain as DomainCreate;
8
use AfriCC\EPP\Validator;
9
10
class Domain extends DomainCreate implements ExtensionInterface
11
{
12
    use ExtensionTrait;
13
14
    protected $extension = 'extdom';
15
    protected $extension_xmlns = 'http://www.dns.pl/nask-epp-schema/extdom-2.0';
16
17
    public function setBook()
18
    {
19
        $this->set('//epp:epp/epp:command/epp:extension/extdom:create/extdom:book');
20
    }
21
22
    public function addNs($host)
23
    {
24
        if (!Validator::isHostname($host)) {
25
            throw new \Exception(sprintf('%s is not a valid host name', $host));
26
        }
27
28
        $this->set('domain:ns[]', $host);
29
    }
30
31
    public function addHostObj($host)
32
    {
33
        return $this->addNs($host);
34
    }
35
36
    public function setAdminContact($admin_contact)
37
    {
38
        return false; //TODO: should this throw if registry doesn't allow Admin contact?
39
    }
40
41
    public function setTechContact($tech_contact)
42
    {
43
        return false; //TODO: should this throw if registry doesn't allow Tech contact?
44
    }
45
46
    public function setBillingContact($billing_contact)
47
    {
48
        return false; //TODO: should this throw if registry doesn't allow Billing contact?
49
    }
50
}
51