30 lines
625 B
PHP
30 lines
625 B
PHP
<?php
|
|
|
|
namespace HermannTelser\Gutachten\DB\Update;
|
|
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|
use HermannTelser\Gutachten\DB\DbFunction;
|
|
|
|
class UpdateRow
|
|
{
|
|
/**
|
|
* @param mixed $id
|
|
*
|
|
* @return bool
|
|
*/
|
|
public static function update()
|
|
{
|
|
$table = GeneralUtility::_GP('table');
|
|
$rowdata = GeneralUtility::_GP('rowdata');
|
|
$data = json_decode($rowdata, true);
|
|
$id = GeneralUtility::_GP('id');
|
|
$update_array = [];
|
|
foreach ($data as $key => $subdata) {
|
|
foreach ($subdata as $field => $value) {
|
|
$update_array[$field] = $value;
|
|
}
|
|
}
|
|
DbFunction::secureUpdate($table, $update_array, "id = $id");
|
|
}
|
|
}
|