1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is part of the php-epp2 library. |
5
|
|
|
* |
6
|
|
|
* (c) Gunter Grodotzki <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE file |
9
|
|
|
* that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace AfriCC\EPP\Frame\Command\Create; |
13
|
|
|
|
14
|
|
|
use AfriCC\EPP\ContactTrait; |
15
|
|
|
use AfriCC\EPP\Frame\Command\Create; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @see http://tools.ietf.org/html/rfc5733#section-3.2.1 |
19
|
|
|
*/ |
20
|
|
|
class Contact extends Create |
21
|
|
|
{ |
22
|
|
|
use ContactTrait; |
23
|
|
|
|
24
|
|
|
public function setId($id) |
25
|
|
|
{ |
26
|
|
|
$this->appendId('contact:id', $id); |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
public function setName($name) |
30
|
|
|
{ |
31
|
|
|
$this->appendName('contact:postalInfo[@type=\'%s\']/contact:name', $name); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function setOrganization($org) |
35
|
|
|
{ |
36
|
|
|
$this->appendOrganization('contact:postalInfo[@type=\'%s\']/contact:org', $org); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function addStreet($street) |
40
|
|
|
{ |
41
|
|
|
$this->appendStreet('contact:postalInfo[@type=\'%s\']/contact:addr/contact:street[]', $street); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function setCity($city) |
45
|
|
|
{ |
46
|
|
|
$this->appendCity('contact:postalInfo[@type=\'%s\']/contact:addr/contact:city', $city); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public function setProvince($sp) |
50
|
|
|
{ |
51
|
|
|
$this->appendProvince('contact:postalInfo[@type=\'%s\']/contact:addr/contact:sp', $sp); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function setPostalCode($pc) |
55
|
|
|
{ |
56
|
|
|
$this->appendPostalCode('contact:postalInfo[@type=\'%s\']/contact:addr/contact:pc', $pc); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function setCountryCode($cc) |
60
|
|
|
{ |
61
|
|
|
$this->appendCountryCode('contact:postalInfo[@type=\'%s\']/contact:addr/contact:cc', $cc); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function setVoice($voice, $extension = null) |
65
|
|
|
{ |
66
|
|
|
$this->appendVoice('contact:voice', $voice, $extension); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function setFax($fax, $extension = null) |
70
|
|
|
{ |
71
|
|
|
$this->appendFax('contact:fax', $fax, $extension); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
public function setEmail($email) |
75
|
|
|
{ |
76
|
|
|
$this->appendEmail('contact:email', $email); |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
public function setAuthInfo($pw = null) |
80
|
|
|
{ |
81
|
|
|
return $this->appendAuthInfo('contact:authInfo/contact:pw', $pw); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
public function addDisclose($value, $flag = 0) |
85
|
|
|
{ |
86
|
|
|
$this->appendDisclose(sprintf('contact:disclose[@flag=\'%d\']/contact:%s', (int) $flag, $value)); |
87
|
|
|
} |
88
|
|
|
} |
89
|
|
|
|