Commit 89abf953 authored by abkrim's avatar abkrim

OVH finalizado 2018-12-29-07-54-11

parent 40273115
......@@ -70,8 +70,16 @@ class ApiMe extends OvhConnect
{
$object = $this->setEndObject();
//dd($object, $this->parameters);
try {
return $this->ovh->get($object);
if(!is_null($this->parameters)) {
return $this->ovh->get($object, $this->parameters);
} else {
return $this->ovh->get($object);
}
} catch (\GuzzleHttp\Exception\ClientException $e) {
$response = $e->getResponse();
$responseBodyAsString = $response->getBody()->getContents();
......@@ -107,6 +115,7 @@ class ApiMe extends OvhConnect
if (!is_null($this->actionId)) {
$object = $object.'/'.$this->actionId;
}
return $object;
}
......@@ -137,4 +146,5 @@ class ApiMe extends OvhConnect
return $this;
}
}
\ No newline at end of file
......@@ -12,6 +12,13 @@ class OvhConnect {
protected $ovh;
/**
* Array for parameters
*
* @var array
*/
protected $parameters;
/**
* OvhConnect constructor.
* @param string|null $endpoint
......@@ -49,4 +56,11 @@ class OvhConnect {
echo $responseBodyAsString;
}
}
public function setParameters(array $params)
{
$this->parameters = $params;
return $this;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment