-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
/
MoveRepeatingGroup.php
40 lines (34 loc) · 1.15 KB
/
MoveRepeatingGroup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
declare(strict_types=1);
namespace PhpMyAdmin\Controllers\Normalization;
use PhpMyAdmin\Controllers\InvocableController;
use PhpMyAdmin\Current;
use PhpMyAdmin\Http\Response;
use PhpMyAdmin\Http\ServerRequest;
use PhpMyAdmin\Normalization;
use PhpMyAdmin\ResponseRenderer;
final class MoveRepeatingGroup implements InvocableController
{
public function __construct(
private readonly ResponseRenderer $response,
private readonly Normalization $normalization,
) {
}
public function __invoke(ServerRequest $request): Response
{
$repeatingColumns = $request->getParsedBodyParam('repeatingColumns');
$newTable = $request->getParsedBodyParam('newTable');
$newColumn = $request->getParsedBodyParam('newColumn');
$primaryColumns = $request->getParsedBodyParam('primary_columns');
$res = $this->normalization->moveRepeatingGroup(
$repeatingColumns,
$primaryColumns,
$newTable,
$newColumn,
Current::$table,
Current::$database,
);
$this->response->addJSON($res);
return $this->response->response();
}
}