Start Point al 2026
This commit is contained in:
commit
8a76e1db3b
371 files changed
+160283
No files matched your search
@@ -0,0 +1,81 @@
|
||||
<?php namespace App\Models;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `CSiCoCars` (
|
||||
`caIDcar` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identificativo univoco del veicolo',
|
||||
`caTarga` varchar(10) NOT NULL COMMENT 'Targa del veicolo',
|
||||
`caDescrizione` text NOT NULL COMMENT 'Descrizione del veicolo',
|
||||
`caDataAssicurazione` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Prossima data di scadenza dell''assicurazione del veicolo',
|
||||
`caTipoGomme` enum('Invernali','Estive','4Stagioni') NOT NULL DEFAULT '4Stagioni' COMMENT 'Tipologia di pneumatici in dotazione al veicolo',
|
||||
`caCreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Timestamp di inserimento del record nel database',
|
||||
`caUpdatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Timestamp in cui il record è stato aggiornato',
|
||||
`caStato` enum('Disponibile','Occupata','Dismessa') NOT NULL DEFAULT 'Disponibile' COMMENT 'Stato della macchina, riassume gli eventi',
|
||||
`caDeletedAt` timestamp NULL DEFAULT NULL COMMENT 'Timestamp in cui il record è stato virtualmente cancellato (senza delete reale)',
|
||||
PRIMARY KEY (`caIDcar`),
|
||||
UNIQUE KEY `caIDcar` (`caIDcar`),
|
||||
UNIQUE KEY `caTarga` (`caTarga`, `smDeletedAt`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='Tabella con tutte le macchine della CSiCo.';
|
||||
|
||||
Fields:
|
||||
Tab: CSiCoCars = ['caIDcar', 'caTarga', 'caDescrizione', 'caDataAssicurazione', 'caTipoGomme', 'caCreatedAt', 'caUpdatedAt', 'caStato', 'caDeletedAt'];
|
||||
|
||||
*/
|
||||
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
|
||||
|
||||
class CSiCoCars_Model extends Model {
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Property
|
||||
|
||||
|
||||
protected $table = 'CSiCoCars';
|
||||
protected $primaryKey = 'caIDcar';
|
||||
|
||||
protected $returnType = 'App\Entities\CSiCoCar';
|
||||
//protected $returnType = 'array';
|
||||
|
||||
protected $allowedFields = ['caTarga', 'caDescrizione', 'caDataAssicurazione', 'caTipoGomme', 'caStato'];
|
||||
|
||||
protected $useSoftDeletes = true;
|
||||
protected $useTimestamps = true;
|
||||
protected $createdField = 'caCreatedAt';
|
||||
protected $updatedField = 'caUpdatedAt';
|
||||
protected $deletedField = 'caDeletedAt';
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Events
|
||||
|
||||
|
||||
//protected $beforeInsert = ['beforeInsert'];
|
||||
//protected $afterInsert = ['afterInsert'];
|
||||
//protected $beforeUpdate = ['beforeUpdate'];
|
||||
//protected $afterUpdate = ['afterUpdate'];
|
||||
//protected $beforeDelete = ['beforeDelete'];
|
||||
//protected $afterDelete = ['afterDelete'];
|
||||
//protected $afterFind = ['afterFind'];
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Methods
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
}//class CSiCoCars_Model
|
||||
Reference in new issue
Block a user