From b8e17a5cdea8c2be212562295267f9a5715e392e Mon Sep 17 00:00:00 2001 From: huzaif Date: Fri, 11 Dec 2020 11:18:25 +0530 Subject: [PATCH] added retrieve_phlo_run --- src/Plivo/Resources/PHLO/Phlo.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Plivo/Resources/PHLO/Phlo.php b/src/Plivo/Resources/PHLO/Phlo.php index 58875c2e..05617df1 100644 --- a/src/Plivo/Resources/PHLO/Phlo.php +++ b/src/Plivo/Resources/PHLO/Phlo.php @@ -63,12 +63,15 @@ class Phlo * @param null $id * @param null $baseUrl */ - public function __construct($client = null, $id = null, $baseUrl = null) + + public function __construct($client = null, $id = null, $baseUrl = null, $runId = null) { $this->phloId = $id; + $this->runId = $runId; $this->client = $client; $this->baseUrl = $baseUrl; $this->phloUrl = $this->baseUrl . "/phlo/" . $this->phloId; + $this->phlorunnerUrl = $this->baseUrl . "/phlo/" . $this->phloId. "/runs/" . $this->runId; } /** @@ -92,6 +95,20 @@ public function getPhlo($id) // return json_encode($response->getContent(), JSON_FORCE_OBJECT); } + /** + * @param $id + * @param $runId + * @return mixed + */ + + public function get_runner($id,$runId) + { + $phlo = new self($this->client, $id, $this->baseUrl, $runId); + $response = $phlo->client->getPhlorunner($phlo->phlorunnerUrl, []); + return $response->getContent(); + //return json_encode($response->getContent(), JSON_FORCE_OBJECT); + } + /** * @param null $nodeType * @param null $nodeId