Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
13 / 13 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
DepartmentDelete | |
100.00% |
13 / 13 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
readResponse | |
100.00% |
13 / 13 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | /** |
4 | * @package 115Mandant |
5 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG |
6 | **/ |
7 | |
8 | namespace BO\Zmsadmin; |
9 | |
10 | use BO\Mellon\Validator; |
11 | use BO\Slim\Render; |
12 | use BO\Zmsentities\Department as Entity; |
13 | |
14 | /** |
15 | * Handle requests concerning services |
16 | * |
17 | */ |
18 | class DepartmentDelete extends BaseController |
19 | { |
20 | /** |
21 | * @SuppressWarnings(Param) |
22 | * @return String |
23 | */ |
24 | public function readResponse( |
25 | \Psr\Http\Message\RequestInterface $request, |
26 | \Psr\Http\Message\ResponseInterface $response, |
27 | array $args |
28 | ) { |
29 | $entityId = Validator::value($args['id'])->isNumber()->getValue(); |
30 | |
31 | $entity = \App::$http->readGetResult('/department/' . $entityId . '/')->getEntity(); |
32 | $departmentName = $entity->name; |
33 | |
34 | |
35 | \App::$http->readDeleteResult( |
36 | '/department/' . $entityId . '/' |
37 | )->getEntity(); |
38 | return \BO\Slim\Render::redirect( |
39 | 'owner_overview', |
40 | array(), |
41 | array( |
42 | 'success' => 'department_deleted', |
43 | 'departmentName' => $departmentName ) |
44 | ); |
45 | } |
46 | } |