-
Notifications
You must be signed in to change notification settings - Fork 164
/
Copy pathsidnEppException.php
49 lines (45 loc) · 1.63 KB
/
sidnEppException.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
namespace Metaregistrar\EPP;
/**
* <epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:sidn-ext-epp="http://rxsd.domain-registry.nl/sidn-ext-epp-1.0">
* <response>
* <result code="2200">
* <msg>Validation of the transaction failed.</msg>
* </result>
* <extension>
* <sidn-ext-epp:ext>
* <sidn-ext-epp:response>
* <sidn-ext-epp:msg code="C0033a" field="New password">Invalid password: a password must contain a minimum of 10 characters.</sidn-ext-epp:msg>
* </sidn-ext-epp:response>
* </sidn-ext-epp:ext>
* </extension>
* <trID>
* <clTRID>5b08a3e6497d8</clTRID>
* <svTRID>D3074A84-6928-DA21-1790-A50F2AC086EC</svTRID>
* </trID>
* </response>
* </epp>
*/
/**
* Class sidnEppException
* @package Metaregistrar\EPP
*/
class sidnEppException extends eppException {
/**
* @var eppResponse
*/
private $eppresponse;
public function __construct($message = "", $code = 0, ?\Exception $previous = null, $reason = null, $command = null) {
if ($command) {
$this->eppresponse = new eppResponse();
$this->eppresponse->loadXML($command);
}
parent::__construct($message, $code, $previous, $reason, $command);
}
public function getSidnErrorCode() {
return $this->eppresponse->queryPath('/epp:epp/epp:response/epp:extension/sidn-ext-epp:ext/sidn-ext-epp:response/sidn-ext-epp:msg/@code');
}
public function getSidnErrorMessage() {
return $this->eppresponse->queryPath('/epp:epp/epp:response/epp:extension/sidn-ext-epp:ext/sidn-ext-epp:response/sidn-ext-epp:msg');
}
}