| @@ 81-98 (lines=18) @@ | ||
| 78 | * @return Result |
|
| 79 | * @throws Exception |
|
| 80 | */ |
|
| 81 | public function get($experimentId) |
|
| 82 | { |
|
| 83 | if (!is_int($experimentId)) { |
|
| 84 | throw new Exception("Integer experiment ID expected, while got '$experimentId'", |
|
| 85 | Exception::CODE_INVALID_ARG); |
|
| 86 | } |
|
| 87 | ||
| 88 | if ($experimentId<0) { |
|
| 89 | throw new Exception("A positive experiment ID expected"); |
|
| 90 | } |
|
| 91 | ||
| 92 | $result = $this->client->sendApiRequest("/experiments/$experimentId"); |
|
| 93 | ||
| 94 | $experiment = new Experiment($result->getDecodedJsonData()); |
|
| 95 | $result->setPayload($experiment); |
|
| 96 | ||
| 97 | return $result; |
|
| 98 | } |
|
| 99 | ||
| 100 | /** |
|
| 101 | * Get results for a single experiment |
|
| @@ 70-86 (lines=17) @@ | ||
| 67 | * @return Result |
|
| 68 | * @throws Exception |
|
| 69 | */ |
|
| 70 | public function get($projectId) |
|
| 71 | { |
|
| 72 | if (!is_int($projectId)) { |
|
| 73 | throw new Exception("Integer project ID expected, while got '$projectId'"); |
|
| 74 | } |
|
| 75 | ||
| 76 | if ($projectId<0) { |
|
| 77 | throw new Exception("A positive project ID expected"); |
|
| 78 | } |
|
| 79 | ||
| 80 | $result = $this->client->sendApiRequest("/projects/$projectId"); |
|
| 81 | ||
| 82 | $project = new Project($result->getDecodedJsonData()); |
|
| 83 | $result->setPayload($project); |
|
| 84 | ||
| 85 | return $result; |
|
| 86 | } |
|
| 87 | ||
| 88 | /** |
|
| 89 | * Create a new Project in your account. |
|