Files
CSiCoDB2/app/Models/SIMEvents_Model.php
T
2026-05-06 11:04:41 +02:00

80 lines
2.4 KiB
PHP

<?php namespace App\Models;
/*
CREATE TABLE IF NOT EXISTS `SIMEvents` (
`esmIDsimEvent` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identificativo univoco dell''evento',
`esmIDsim` int(11) NOT NULL COMMENT 'Identificativo univoco della SIM telefonica',
`esmIDlavoratore` int(11) NOT NULL COMMENT 'Identificativo univoco del lavoratore',
`esmDescrizione` text NOT NULL COMMENT 'Descrizione esplicativa del''evento',
`esmData` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'Data dell''evento',
`esmTipologia` enum('Presa','Restituita','Dismessa') NOT NULL DEFAULT 'Restituita' COMMENT 'Tipologia dell''evento',
PRIMARY KEY (`esmIDsimEvent`),
UNIQUE KEY `esmIDsimEvent` (`esmIDsimEvent`),
KEY `FK_SIMEvents-SIMs` (`esmIDsim`),
KEY `FK_SIMEvents-Lavoratori` (`esmIDlavoratore`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='Tabella con tutti gli eventi riferiti alle SIM aziendali.';
Fields:
Tab: SIMEvents = ['esmIDsimEvent', 'esmIDsim', 'esmIDlavoratore', 'esmDescrizione', 'esmData', 'esmTipologia'];
*/
use CodeIgniter\Model;
class SIMEvents_Model extends Model {
//--------------------------------------------------------------------
// Property
protected $table = 'SIMEvents';
protected $primaryKey = 'esmIDsimEvent';
protected $returnType = 'App\Entities\SIMEvnt';
//protected $returnType = 'array';
protected $allowedFields = ['esmIDsim', 'esmIDlavoratore', 'esmDescrizione', 'esmData', 'esmTipologia'];
protected $useSoftDeletes = false;
protected $useTimestamps = false;
//protected $createdField = 'spCreatedAt';
//protected $updatedField = 'spUpdatedAt';
//protected $deletedField = 'spDeletedAt';
//--------------------------------------------------------------------
// Events
//protected $beforeInsert = ['beforeInsert'];
//protected $afterInsert = ['afterInsert'];
//protected $beforeUpdate = ['beforeUpdate'];
//protected $afterUpdate = ['afterUpdate'];
//protected $beforeDelete = ['beforeDelete'];
//protected $afterDelete = ['afterDelete'];
//protected $afterFind = ['afterFind'];
//--------------------------------------------------------------------
// Methods
//--------------------------------------------------------------------
}//class SIMEvents_Model