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

Contact   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 36
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getExtensionNamespace() 0 4 1
A setIndividual() 0 3 2
A setConsentForPublishing() 0 3 2
1
<?php
2
namespace AfriCC\EPP\Extension\NASK\Create;
3
4
use AfriCC\EPP\ExtensionInterface;
5
use AfriCC\EPP\Frame\Command\Create\Contact as ContactCreate;
6
7
class Contact extends ContactCreate implements ExtensionInterface
8
{
9
10
    protected $extension = 'extcon';
11
    protected $extension_xmlns = 'http://www.dns.pl/nask-epp-schema/extcon-2.0';
12
13
    public function getExtensionNamespace()
14
    {
15
        return $this->extension_xmlns;
16
    }
17
18
    /**
19
     * Set entity type of contact
20
     *
21
     * @param bool $individual True if person, false if company
22
     */
23
    public function setIndividual($individual=false){
24
        $this->set('//epp:epp/epp:command/epp:extension/extcon:create/extcon:individual', $individual ? 1 : 0);
25
    }
26
27
    /**
28
     * Set consent for publishing
29
     *
30
     * Don't use
31
     *
32
     * Ignored since 6.1.19
33
     * Up until 6.1.19 this HAD to be true if Individual was to be False
34
     *
35
     * @deprecated Since NASK registry 6.1.19, removed in registry 6.2.1
36
     *
37
     * @param bool $consent
38
     */
39
    public function setConsentForPublishing($consent=false){
40
        $this->set('//epp:epp/epp:command/epp:extension/extcon:create/extcon:consentForPublishing', $consent ? 1 : 0 );
41
    }
42
}
43
44