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.
This commit is contained in:
@@ -9,6 +9,11 @@ class V1_LicenzeController extends App_Controller_Rest_Controller
|
||||
parent::init();
|
||||
}
|
||||
|
||||
public function deleteAction()
|
||||
{
|
||||
$this->disableCallAction();
|
||||
}
|
||||
|
||||
//-----------------------------------------------
|
||||
|
||||
public function switchMethodFunction($method)
|
||||
@@ -33,21 +38,14 @@ class V1_LicenzeController extends App_Controller_Rest_Controller
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function afterDeleteElement($id): void
|
||||
{
|
||||
$record = $this->_genericModel->getRecordById($this->_resourceName, $id);
|
||||
$this->inserimentoRecordDiLog($record, 'Eliminazione');
|
||||
}
|
||||
|
||||
private function inserimentoRecordDiLog($data, $op)
|
||||
{
|
||||
/*$this->_genericModel->insert('LogLicenze', [
|
||||
'Operazione' => $op,
|
||||
'Data' => date('Y-m-d H:i:s'),
|
||||
'Utente' => $this->_authInfo->getIdentity(),
|
||||
'Descrizione' => '',
|
||||
'IdElemento' => ''
|
||||
]);*/
|
||||
$this->_genericModel->insert('LogLicenze', [
|
||||
'Descrizione' => $op,
|
||||
'IdentificativoPC' => $data['IdentificativoPC'],
|
||||
'PartitaIva' => $data['PartitaIva'],
|
||||
'CodiceFiscale' => $data['CodiceFiscale']
|
||||
]);
|
||||
}
|
||||
|
||||
}//END CLASS
|
||||
|
||||
Reference in New Issue
Block a user