80 lines
2.7 KiB
PHP
80 lines
2.7 KiB
PHP
<?php namespace App\Models;
|
|
|
|
|
|
/*
|
|
|
|
CREATE TABLE IF NOT EXISTS `CreditCardEvents` (
|
|
`eccIDcreditEvent` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identificativo univoco dell''evento',
|
|
`eccIDcard` int(11) NOT NULL COMMENT 'Identificativo univoco della carta di credito aziendale',
|
|
`eccIDlavoratore` int(11) NOT NULL COMMENT 'Identificativo univoco del lavoratore che utilizza la carta',
|
|
`eccDescrizione` text NOT NULL COMMENT 'Descrizione esplicativa del motivo per cui si utilizza la carta',
|
|
`eccData` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Data in cui si è utilizzato la carta',
|
|
`eccCredito` float NOT NULL DEFAULT '0' COMMENT 'Stima del credito rimasto alla data dell''evento',
|
|
`eccTipologia` enum('Presa','Restituita') NOT NULL DEFAULT 'Presa' COMMENT 'Tipologia dell''evento',
|
|
PRIMARY KEY (`eccIDcreditEvent`),
|
|
KEY `FK_CreditEvents-CreditCards` (`eccIDcard`),
|
|
KEY `FK_CreditEvents-Lavoratori` (`eccIDlavoratore`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8 COMMENT='Tabella con tutti gli eventi riferiti alle carte di credito.';
|
|
|
|
Fields:
|
|
Tab: CreditCardEvents = ['eccIDcreditEvent', 'eccIDcard', 'eccIDlavoratore', 'eccDescrizione', 'eccData', 'eccCredito', 'eccTipologia'];
|
|
|
|
*/
|
|
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
|
|
|
|
class CreditCardEvents_Model extends Model {
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
// Property
|
|
|
|
|
|
protected $table = 'CreditCardEvents';
|
|
protected $primaryKey = 'eccIDcreditEvent';
|
|
|
|
protected $returnType = 'App\Entities\CreditCardEvnt';
|
|
//protected $returnType = 'array';
|
|
|
|
protected $allowedFields = ['eccIDcard', 'eccIDlavoratore', 'eccDescrizione', 'eccData', 'eccCredito', 'eccTipologia'];
|
|
|
|
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 CreditCardEvents_Model
|
|
|