Start Point al 2026
This commit is contained in:
commit
8a76e1db3b
371 files changed
+160283
No files matched your search
@@ -0,0 +1,79 @@
|
||||
<?php namespace App\Models;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `Clienti` (
|
||||
`clIDcliente` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identificativo univoco del cliente',
|
||||
`clNome` varchar(32) NOT NULL COMMENT 'Nome, per riferimento interno, del cliente',
|
||||
`clInfo` text NOT NULL COMMENT 'Informazioni sul cliente che vogliamo storicizzare',
|
||||
`clCreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Timestamp di inserimento del record nel database',
|
||||
`clUpdatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Timestamp in cui il record è stato aggiornato',
|
||||
`clDeletedAt` timestamp NULL DEFAULT NULL COMMENT 'Timestamp in cui il record è stato virtualmente cancellato (senza delete reale)',
|
||||
PRIMARY KEY (`clIDcliente`),
|
||||
UNIQUE KEY `clIDcliente` (`clIDcliente`),
|
||||
UNIQUE KEY `clNome` (`clNome`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COMMENT='Elenco dei Clienti della CSiCo';
|
||||
|
||||
Fields:
|
||||
Tab: Clienti = ['clIDcliente', 'clNome', 'clInfo', 'clCreatedAt', 'clUpdatedAt', 'clDeletedAt'];
|
||||
|
||||
*/
|
||||
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
|
||||
|
||||
class Clienti_Model extends Model{
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Property
|
||||
|
||||
|
||||
protected $table = 'Clienti';
|
||||
protected $primaryKey = 'clIDcliente';
|
||||
|
||||
//protected $returnType = 'App\Entities\Cliente';
|
||||
protected $returnType = 'array';
|
||||
|
||||
protected $allowedFields = ['clNome', 'clInfo'];
|
||||
|
||||
protected $useSoftDeletes = true;
|
||||
protected $useTimestamps = true;
|
||||
protected $createdField = 'clCreatedAt';
|
||||
protected $updatedField = 'clUpdatedAt';
|
||||
protected $deletedField = 'clDeletedAt';
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Events
|
||||
|
||||
|
||||
//protected $beforeInsert = ['beforeInsert'];
|
||||
//protected $afterInsert = ['afterInsert'];
|
||||
//protected $beforeUpdate = ['beforeUpdate'];
|
||||
//protected $afterUpdate = ['afterUpdate'];
|
||||
//protected $beforeDelete = ['beforeDelete'];
|
||||
//protected $afterDelete = ['afterDelete'];
|
||||
//protected $afterFind = ['afterFind'];
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Methods
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
}//class Clienti_Model
|
||||
|
||||
|
||||
Reference in new issue
Block a user