Skip to content

Commit

Permalink
getComponents method - returns parsed data from indexAction
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejhlavacek committed Oct 9, 2013
1 parent 8f59a5b commit 2a967a7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Keboola/StorageApi/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1468,4 +1468,23 @@ public function setBackoffMaxTries($backoffMaxTries)
return $this;
}

/**
*
* Returns components from indexAction
*
* @return array
*/
public function getComponents()
{
$data = $this->indexAction();
$components = array();
if (!isset($data["components"])) {
return $components;
}
foreach($data["components"] as $component) {
$components[$component["id"]] = $component["uri"];
}
return $components;
}

}

0 comments on commit 2a967a7

Please sign in to comment.