Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| ProcessListByExternalUserId | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| readResponse | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * @package ZMS API |
| 5 | **/ |
| 6 | |
| 7 | namespace BO\Zmsapi; |
| 8 | |
| 9 | use BO\Slim\Render; |
| 10 | use BO\Mellon\Validator; |
| 11 | use BO\Zmsdb\Process; |
| 12 | |
| 13 | class ProcessListByExternalUserId extends BaseController |
| 14 | { |
| 15 | /** |
| 16 | * @SuppressWarnings(Param) |
| 17 | * @return String |
| 18 | */ |
| 19 | public function readResponse( |
| 20 | \Psr\Http\Message\RequestInterface $request, |
| 21 | \Psr\Http\Message\ResponseInterface $response, |
| 22 | array $args |
| 23 | ) { |
| 24 | $workstation = (new Helper\User($request, 2))->checkRights(); |
| 25 | $externalUserId = $args['externalUserId']; // present and validated because of URL argument |
| 26 | $status = Validator::param('status')->isString()->setDefault(null)->getValue(); |
| 27 | $filterId = Validator::param('filterId')->isNumber()->setDefault(null)->getValue(); |
| 28 | $resolveReferences = Validator::param('resolveReferences')->isNumber()->setDefault(0)->getValue(); |
| 29 | $limit = Validator::param('limit')->isNumber()->setDefault(100)->getValue(); |
| 30 | |
| 31 | $processList = (new Process())->readProcessListByExternalUserId($externalUserId, $filterId, $status, $resolveReferences, $limit); |
| 32 | |
| 33 | $message = Response\Message::create($request); |
| 34 | $message->data = $processList->withAccess($workstation->getUseraccount()); |
| 35 | |
| 36 | $response = Render::withLastModified($response, time(), '0'); |
| 37 | $response = Render::withJson($response, $message, 200); |
| 38 | return $response; |
| 39 | } |
| 40 | } |