Skip to content

Commit 7f0b3e8

Browse files
authored
Merge pull request #40 from InterNetX/PPM-1714
PPM-1714
2 parents 90c7931 + d921e9c commit 7f0b3e8

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "internetx/php-domainrobot-sdk",
3-
"version": "0.9.19",
3+
"version": "0.9.21",
44
"description": "A php package for easy integration of the domainrobot API powered by InterNetX GmbH.",
55
"type": "library",
66
"license": "MIT",

src/Domainrobot.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44

55
use Domainrobot\Lib\DomainrobotConfig;
66
use Domainrobot\Service\CertificateService;
7+
use Domainrobot\Service\ContactService;
8+
use Domainrobot\Service\DocumentService;
79
use Domainrobot\Service\DomainStudioService;
810
use Domainrobot\Service\DomainService;
911
use Domainrobot\Service\DomainBulkService;
1012
use Domainrobot\Service\SslContactService;
11-
use Domainrobot\Service\ContactService;
1213
use Domainrobot\Service\DomainCancelationService;
1314
use Domainrobot\Service\TransferOutService;
1415
use Domainrobot\Service\TrustedApplicationService;
@@ -24,6 +25,7 @@
2425
use Domainrobot\Service\LoginService;
2526
use Domainrobot\Service\DomainPremiumService;
2627
use Domainrobot\Service\RedirectService;
28+
2729
class Domainrobot
2830
{
2931
// private static $instance = null;
@@ -50,6 +52,13 @@ class Domainrobot
5052
*/
5153
public $contact;
5254

55+
/**
56+
* Interface for all document related requests
57+
*
58+
* @var DomainService
59+
*/
60+
public $document;
61+
5362
/**
5463
* Interface for all domain related requests
5564
*
@@ -196,6 +205,7 @@ public function __construct($domainrobotConfig = [])
196205
$this->setDomainrobotConfig(new DomainrobotConfig($domainrobotConfig));
197206
$this->certificate = new CertificateService($this->domainrobotConfig);
198207
$this->contact = new ContactService($this->domainrobotConfig);
208+
$this->document = new DocumentService($this->domainrobotConfig);
199209
$this->domain = new DomainService($this->domainrobotConfig);
200210
$this->domainBulk = new DomainBulkService($this->domainrobotConfig);
201211
$this->domainCancelation = new DomainCancelationService($this->domainrobotConfig);

src/Service/DocumentService.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace Domainrobot\Service;
4+
5+
use Domainrobot\Lib\DomainrobotConfig;
6+
use Domainrobot\Lib\DomainrobotPromise;
7+
use Domainrobot\Service\DomainrobotService;
8+
9+
class DocumentService extends DomainrobotService
10+
{
11+
public function info($id)
12+
{
13+
$domainrobotPromise = $this->infoAsync($id);
14+
$domainrobotResult = $domainrobotPromise->wait();
15+
16+
return $domainrobotResult;
17+
}
18+
19+
/**
20+
* Sends a contact info request.
21+
*
22+
* @param int $id
23+
* @return DomainrobotPromise
24+
*/
25+
public function infoAsync($id)
26+
{
27+
return $this->sendRequest(
28+
$this->domainrobotConfig->getUrl() . "/document/$id",
29+
'GET'
30+
);
31+
}
32+
}

0 commit comments

Comments
 (0)