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.
52 lines
1.1 KiB
PHP
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
|