82 lines
3.0 KiB
PHP
82 lines
3.0 KiB
PHP
<?php namespace App\Models;
|
|
|
|
|
|
/*
|
|
|
|
CREATE TABLE IF NOT EXISTS `Issues` (
|
|
`isIDissue` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identificativo univoco dell''issue',
|
|
`isTipologia` enum('BUG','IDEA','INFO','RICHIESTA') DEFAULT 'INFO' COMMENT 'Indica la tipologia dell''issue: -BUG indica un malfuzionamento della webapp o una mancanza; - IDEA indica una funzionalità da inserire o descrive un possibile miglioramento; INFO indica delle informazioni utili per tutti e che è utile tenere in evidenza.',
|
|
`isStato` enum('Da_Leggere','Da_Fare','In_Working','Sospesa','Abortita','Done') DEFAULT 'Da_Leggere' COMMENT 'Stato associabile all''issue.',
|
|
`isIDlavoratore` int(11) NOT NULL COMMENT 'Identificativo del lavoratore che ha inserito l''issue',
|
|
`isTesto` text NOT NULL COMMENT 'Testo o descrizione dell''issue.',
|
|
`isCreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Timestamp di inserimento del record nel database',
|
|
`isUpdatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Timestamp in cui il record è stato aggiornato',
|
|
`isDeletedAt` timestamp NULL DEFAULT NULL COMMENT 'Timestamp in cui il record è stato virtualmente cancellato (senza delete reale)',
|
|
PRIMARY KEY (`isIDissue`),
|
|
KEY `FK_Issues-Lavoratori` (`isIDlavoratore`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Tabella con le issue relative alla webapplication. Utile per segnalare all''amministratore eventuali bug, migliorie o per evidenziare a tutti delle informazioni.';
|
|
|
|
Fields:
|
|
Tab: Issues = ['isIDissue', 'isTipologia', 'isStato', 'isIDlavoratore', 'isTesto', 'isCreatedAt', 'isUpdatedAt', 'isDeletedAt'];
|
|
|
|
*/
|
|
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
|
|
|
|
class Issues_Model extends Model{
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
// Property
|
|
|
|
|
|
protected $table = 'Issues';
|
|
protected $primaryKey = 'isIDissue';
|
|
|
|
protected $returnType = 'App\Entities\Issue';
|
|
//protected $returnType = 'array';
|
|
|
|
protected $allowedFields = ['isIDissue', 'isTipologia', 'isStato', 'isIDlavoratore', 'isTesto'];
|
|
|
|
protected $useSoftDeletes = true;
|
|
protected $useTimestamps = true;
|
|
protected $createdField = 'isCreatedAt';
|
|
protected $updatedField = 'isUpdatedAt';
|
|
protected $deletedField = 'isDeletedAt';
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
// Events
|
|
|
|
|
|
//protected $beforeInsert = ['beforeInsert'];
|
|
//protected $afterInsert = ['afterInsert'];
|
|
//protected $beforeUpdate = ['beforeUpdate'];
|
|
//protected $afterUpdate = ['afterUpdate'];
|
|
//protected $beforeDelete = ['beforeDelete'];
|
|
//protected $afterDelete = ['afterDelete'];
|
|
//protected $afterFind = ['afterFind'];
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
// Methods
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
|
|
|
|
}//class Issues_Model
|
|
|
|
|