Files
gutachten_t3/packages/gutachten/Classes/DB/Update/ToggleField.php
T

33 lines
660 B
PHP

<?php
namespace HermannTelser\Gutachten\DB\Update;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use HermannTelser\Gutachten\DB\DbFunction;
class ToggleField
{
/**
* @param mixed $id
*
* @return bool
*/
public static function update()
{
// DbFunction::$debug = 1;
$table = GeneralUtility::_GP('table');
$field = GeneralUtility::_GP('field');
$rowid = GeneralUtility::_GP('id');
$value_array = [];
$value_array[$field] = FALSE;
// $value_array["$field[*]"] = -1;
DbFunction::query("UPDATE $table SET $field = !$field WHERE id=$rowid");
// DbFunction::secureUpdate($table, $update_array, ['id' => $rowid]);
echo 1;
exit;
}
}