Revised log message parameters in `afterInsertElement` and `afterUpdateElement` to provide more descriptive context. This improves the clarity and understanding of logged events.
52 lines
1.2 KiB
PHP
52 lines
1.2 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 dati licenza');
|
|
return $data;
|
|
}
|
|
|
|
public function afterUpdateElement($data)
|
|
{
|
|
$this->inserimentoRecordDiLog($data, 'Inserimento dati licenza');
|
|
return $data;
|
|
}
|
|
|
|
private function inserimentoRecordDiLog($data, $op)
|
|
{
|
|
$this->_genericModel->insert('LogLicenze', [
|
|
'Descrizione' => $op,
|
|
'IdentificativoPC' => $data['IdentificativoPC'],
|
|
'PartitaIva' => $data['PartitaIva'],
|
|
'CodiceFiscale' => $data['CodiceFiscale']
|
|
]);
|
|
}
|
|
|
|
}//END CLASS
|