Start Point al 2026
This commit is contained in:
commit
8a76e1db3b
371 files changed
+160283
No files matched your search
@@ -0,0 +1,82 @@
|
||||
<?php namespace App\Models;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `SIMs` (
|
||||
`smIDsim` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identificativo univoco della SIM telefonica',
|
||||
`smNumero` varchar(16) NOT NULL COMMENT 'Numero telefonico della SIM',
|
||||
`smPIN` varchar(16) NOT NULL COMMENT 'Pin della SIM',
|
||||
`smPUK` varchar(16) NOT NULL COMMENT 'Puk della SIM',
|
||||
`smDescrizione` text NOT NULL COMMENT 'Descrizione dell''articolo',
|
||||
`smCredito` float NOT NULL DEFAULT 0 COMMENT 'Valore stimato del credito nella SIM',
|
||||
`smCreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Timestamp di inserimento del record nel database',
|
||||
`smUpdatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Timestamp in cui il record è stato aggiornato',
|
||||
`smStato` enum('Disponibile','In uso','Scaduta') NOT NULL DEFAULT 'Disponibile' COMMENT 'Stato della SIM, riassume gli eventi',
|
||||
`smDeletedAt` timestamp NULL DEFAULT NULL COMMENT 'Timestamp in cui il record è stato virtualmente cancellato (senza delete reale)',
|
||||
PRIMARY KEY (`smIDsim`),
|
||||
UNIQUE KEY `smIDsim` (`smIDsim`),
|
||||
UNIQUE KEY `smNumero` (`smNumero`, `smDeletedAt`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Tabella con tutte le SIM aziendali.';
|
||||
|
||||
Fields:
|
||||
Tab: SIMs = ['smIDsim', 'smNumero', 'smPIN', 'smPUK', 'smDescrizione', 'smCredito', 'smCreatedAt', 'smUpdatedAt', 'smStato', 'smDeletedAt'];
|
||||
|
||||
*/
|
||||
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
|
||||
|
||||
class SIMs_Model extends Model {
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Property
|
||||
|
||||
|
||||
protected $table = 'SIMs';
|
||||
protected $primaryKey = 'smIDsim';
|
||||
|
||||
protected $returnType = 'App\Entities\SIM';
|
||||
//protected $returnType = 'array';
|
||||
|
||||
protected $allowedFields = ['smNumero', 'smPIN', 'smPUK', 'smDescrizione', 'smCredito', 'smStato'];
|
||||
|
||||
protected $useSoftDeletes = true;
|
||||
protected $useTimestamps = true;
|
||||
protected $createdField = 'smCreatedAt';
|
||||
protected $updatedField = 'smUpdatedAt';
|
||||
protected $deletedField = 'smDeletedAt';
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Events
|
||||
|
||||
|
||||
//protected $beforeInsert = ['beforeInsert'];
|
||||
//protected $afterInsert = ['afterInsert'];
|
||||
//protected $beforeUpdate = ['beforeUpdate'];
|
||||
//protected $afterUpdate = ['afterUpdate'];
|
||||
//protected $beforeDelete = ['beforeDelete'];
|
||||
//protected $afterDelete = ['afterDelete'];
|
||||
//protected $afterFind = ['afterFind'];
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Methods
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
}//class SIMs_Model
|
||||
Reference in new issue
Block a user