12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- /**
- * Define a history.
- * @author Valentin CARRUESCO
- * @category Core
- * @license copyright
- */
- class History extends Entity{
- public $id;
- public $scope; //Scope (plugin, page...) (Texte)
- public $uid; //Item ID/UID concerné (Texte)
- public $comment; //Commentaire (Texte Long)
- public $type; //Type d'historique (Texte)
- public $meta; //Meta données (Texte Long)
- public $sort; //Ordre (int)
-
- const TYPE_COMMENT = 'comment';
- const TYPE_EDIT = 'edit';
- const TYPE_DELETE = 'delete';
- protected $TABLE_NAME = 'history';
- public $fields = array(
- 'id' => 'key',
- 'scope' => 'string',
- 'uid' => 'string',
- 'comment' => 'longstring',
- 'type' => 'string',
- 'sort' => 'int',
- 'meta' => 'longstring'
- );
- public $links = array(
- );
- //Colonnes indexées
- public $indexes = array();
- public static function types($key = null){
- $types = array(
- self::TYPE_COMMENT => array('slug'=>self::TYPE_COMMENT,'label' => 'Commentaire','icon' => 'far fa-comments','color' => '#6ab04c'),
- self::TYPE_EDIT => array('slug'=>self::TYPE_EDIT,'label' => 'Edition','icon' => 'fas fa-marker','color' => '#686de0'),
- self::TYPE_DELETE => array('slug'=>self::TYPE_DELETE,'label' => 'Suppression','icon' => 'fas fa-trash-restore','color' => '#eb4d4b')
- );
- if(!isset($key)) return $types;
- return isset($types[$key]) ? $types[$key] : array('slug'=>'undefined','label'=>'','icon'=>'','color'=>'');
- }
- }
- ?>
|