@@ -7,9 +7,23 @@ class noridEppUpdateDomainRequest extends eppDnssecUpdateDomainRequest {
7
7
8
8
use noridEppDomainRequestTrait;
9
9
10
- function __construct (noridEppDomain $ domain , $ addinfo = null , $ removeinfo = null , $ updateinfo = null , $ forcehostattr = false , $ namespacesinroot = true ) {
11
- parent ::__construct ($ domain , $ addinfo , $ removeinfo , $ updateinfo , $ forcehostattr , $ namespacesinroot );
12
- $ this ->setExtDomain ($ domain );
10
+ function __construct ($ objectname , $ addinfo = null , $ removeinfo = null , $ updateinfo = null , $ forcehostattr = false , $ namespacesinroot = true ) {
11
+ if ($ objectname instanceof eppDomain) {
12
+ $ domainname = $ objectname ->getDomainName ();
13
+ } else {
14
+ $ domainname = $ objectname ;
15
+ }
16
+ if ($ updateinfo === null ) {
17
+ $ updateinfo = new noridEppDomain ($ domainname );
18
+ }
19
+ if ($ objectname instanceof noridEppDomain) {
20
+ $ dataset = $ objectname ->getExtApplicantDataset ();
21
+ if ($ dataset ['versionNumber ' ] !== null && $ dataset ['acceptName ' ] !== null && $ dataset ['acceptDate ' ] !== null ) {
22
+ $ updateinfo ->setExtApplicantDataset ($ dataset ['versionNumber ' ], $ dataset ['acceptName ' ], $ dataset ['acceptDate ' ]);
23
+ }
24
+ }
25
+ parent ::__construct ($ domainname , $ addinfo , $ removeinfo , $ updateinfo , $ forcehostattr , $ namespacesinroot );
26
+ $ this ->setExtDomain ($ updateinfo );
13
27
$ this ->addSessionId ();
14
28
}
15
29
@@ -20,8 +34,12 @@ public function setExtDomain(noridEppDomain $domain) {
20
34
21
35
private function addDomainExtApplicantDataset (noridEppDomain $ domain ) {
22
36
$ dataset = $ domain ->getExtApplicantDataset ();
23
- if ($ domain ->getRegistrant () && (is_null ($ dataset ['versionNumber ' ]) || is_null ($ dataset ['acceptName ' ]) || is_null ($ dataset ['acceptDate ' ]))) {
24
- throw new eppException ('A valid applicant dataset is required to perform an owner change on a domain in the Norid registry ' );
37
+ if ($ dataset ['versionNumber ' ] === null || $ dataset ['acceptName ' ] === null || $ dataset ['acceptDate ' ] === null ) {
38
+ if ($ domain ->getRegistrant ()) {
39
+ throw new eppException ('A valid applicant dataset is required to perform an owner change on a domain in the Norid registry ' );
40
+ } else {
41
+ return ;
42
+ }
25
43
}
26
44
$ datasetElement = $ this ->createElement ('no-ext-domain:applicantDataset ' );
27
45
$ datasetElement ->appendChild ($ this ->createElement ('no-ext-domain:versionNumber ' , $ dataset ['versionNumber ' ]));
0 commit comments