|
@@ 41-50 (lines=10) @@
|
| 38 |
|
* |
| 39 |
|
* @return \League\Fractal\TransformerAbstract |
| 40 |
|
*/ |
| 41 |
|
public function getSingle(Request $request, Response $response, array $args) |
| 42 |
|
{ |
| 43 |
|
$alert = $this->repository->readSingleById($args['id']); |
| 44 |
|
|
| 45 |
|
if (empty($alert)) { |
| 46 |
|
return $this->errorEmpty($response); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
return $this->respond('item', $alert, $this->transformer, $request, $response); |
| 50 |
|
} |
| 51 |
|
|
| 52 |
|
/** |
| 53 |
|
* Returns all currently running alerts |
|
@@ 60-69 (lines=10) @@
|
| 57 |
|
* |
| 58 |
|
* @return \League\Fractal\TransformerAbstract |
| 59 |
|
*/ |
| 60 |
|
public function getActives(Request $request, Response $response) |
| 61 |
|
{ |
| 62 |
|
$actives = $this->repository->readAllByFields(['InProgress' => 1]); |
| 63 |
|
|
| 64 |
|
if (empty($actives)) { |
| 65 |
|
return $this->errorEmpty($response); |
| 66 |
|
} |
| 67 |
|
|
| 68 |
|
return $this->respond('collection', $actives, $this->transformer, $request, $response); |
| 69 |
|
} |
| 70 |
|
|
| 71 |
|
/** |
| 72 |
|
* Returns all alerts in historial order |