Files
GestioneSpiaggia.it/application/modules/v1/controllers/LicenzeController.php
T
giacomo 86eb77de30 Add delete action and enhance logging in LicenzeController
Introduced a new deleteAction method in LicenzeController to handle deletion functionality. Updated the logging mechanism in inserimentoRecordDiLog to capture additional details, enhancing the audit trail for licensing changes. Removed the deprecated afterDeleteElement method.
2025-04-30 08:47:17 +02:00

52 lines
1.1 KiB
PHP

<?php
class V1_LicenzeController extends App_Controller_Rest_Controller
{
public function init()
{
$this->_resourceName = 'Licenze';
parent::init();
}
public function deleteAction()
{
$this->disableCallAction();
}
//-----------------------------------------------
public function switchMethodFunction($method)
{
switch ($method) {
default:
$this->defaultGetList();
break;
}
}
public function afterInsertElement($data)
{
// Inserimento record di Log
$this->inserimentoRecordDiLog($data, 'Inserimento');
return $data;
}
public function afterUpdateElement($data)
{
$this->inserimentoRecordDiLog($data, 'Aggiornamento');
return $data;
}
private function inserimentoRecordDiLog($data, $op)
{
$this->_genericModel->insert('LogLicenze', [
'Descrizione' => $op,
'IdentificativoPC' => $data['IdentificativoPC'],
'PartitaIva' => $data['PartitaIva'],
'CodiceFiscale' => $data['CodiceFiscale']
]);
}
}//END CLASS