Completed
Push — master ( 3b3aeb...14bab3 )
by
unknown
01:16
created

Future::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\Transfer;
4
5
use AfriCC\EPP\ExtensionInterface;
6
use AfriCC\EPP\Frame\Command\Transfer as TransferCommand;
7
use AfriCC\EPP\Validator;
8
use Exception;
9
10
class Future extends TransferCommand implements ExtensionInterface
11
{
12
    protected $extension = 'extfut';
13
14
    protected $extension_xmlns = 'http://www.dns.pl/nask-epp-schema/extfut-2.0';
15
16
    public function getExtensionNamespace()
17
    {
18
        return $this->extension_xmlns;
19
    }
20
21
    /**
22
     * Set domain name for future (option)
23
     *
24
     * @param string $domain Domain Name
25
     *
26
     * @throws Exception on incorrect domain name
27
     */
28
    public function setFuture($domain)
29
    {
30
        if (!Validator::isHostname($domain)) {
31
            throw new Exception(sprintf('%s is not a valid domain name', $domain));
32
        }
33
34
        $this->set('future:name', $domain);
35
    }
36
37
    /**
38
     * Set requested future AuthInfo
39
     *
40
     * @param string $pw AuthInfo for future
41
     * @param string $roid if specified, this is ContactId of registrant and autinfo is of registrant
42
     */
43
    public function setAuthInfo($pw, $roid = null)
44
    {
45
        $node = $this->set('future:authInfo/future:pw', $pw);
46
47
        if ($roid !== null) {
48
            $node->setAttribute('roid', $roid);
49
        }
50
    }
51
52
    public function resendConfirmationRequest()
53
    {
54
        $this->set('//epp:epp/epp:command/epp:extension/extfut:transfer/extfut:resendConfirmationRequest');
55
    }
56
}
57