Skip to content

Commit

Permalink
Merge pull request #40 from InterNetX/PPM-1714
Browse files Browse the repository at this point in the history
PPM-1714
  • Loading branch information
ChripIX authored Sep 3, 2024
2 parents 90c7931 + d921e9c commit 7f0b3e8
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "internetx/php-domainrobot-sdk",
"version": "0.9.19",
"version": "0.9.21",
"description": "A php package for easy integration of the domainrobot API powered by InterNetX GmbH.",
"type": "library",
"license": "MIT",
Expand Down
12 changes: 11 additions & 1 deletion src/Domainrobot.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

use Domainrobot\Lib\DomainrobotConfig;
use Domainrobot\Service\CertificateService;
use Domainrobot\Service\ContactService;
use Domainrobot\Service\DocumentService;
use Domainrobot\Service\DomainStudioService;
use Domainrobot\Service\DomainService;
use Domainrobot\Service\DomainBulkService;
use Domainrobot\Service\SslContactService;
use Domainrobot\Service\ContactService;
use Domainrobot\Service\DomainCancelationService;
use Domainrobot\Service\TransferOutService;
use Domainrobot\Service\TrustedApplicationService;
Expand All @@ -24,6 +25,7 @@
use Domainrobot\Service\LoginService;
use Domainrobot\Service\DomainPremiumService;
use Domainrobot\Service\RedirectService;

class Domainrobot
{
// private static $instance = null;
Expand All @@ -50,6 +52,13 @@ class Domainrobot
*/
public $contact;

/**
* Interface for all document related requests
*
* @var DomainService
*/
public $document;

/**
* Interface for all domain related requests
*
Expand Down Expand Up @@ -196,6 +205,7 @@ public function __construct($domainrobotConfig = [])
$this->setDomainrobotConfig(new DomainrobotConfig($domainrobotConfig));
$this->certificate = new CertificateService($this->domainrobotConfig);
$this->contact = new ContactService($this->domainrobotConfig);
$this->document = new DocumentService($this->domainrobotConfig);
$this->domain = new DomainService($this->domainrobotConfig);
$this->domainBulk = new DomainBulkService($this->domainrobotConfig);
$this->domainCancelation = new DomainCancelationService($this->domainrobotConfig);
Expand Down
32 changes: 32 additions & 0 deletions src/Service/DocumentService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace Domainrobot\Service;

use Domainrobot\Lib\DomainrobotConfig;
use Domainrobot\Lib\DomainrobotPromise;
use Domainrobot\Service\DomainrobotService;

class DocumentService extends DomainrobotService
{
public function info($id)
{
$domainrobotPromise = $this->infoAsync($id);
$domainrobotResult = $domainrobotPromise->wait();

return $domainrobotResult;
}

/**
* Sends a contact info request.
*
* @param int $id
* @return DomainrobotPromise
*/
public function infoAsync($id)
{
return $this->sendRequest(
$this->domainrobotConfig->getUrl() . "/document/$id",
'GET'
);
}
}

0 comments on commit 7f0b3e8

Please sign in to comment.