Widget.class.php 784 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /*
  3. @nom: Widget
  4. @auteur: Valentin CARRUESCO (valentin.carruesco@sys1.fr)
  5. @description: Classe de gestion des widget créés
  6. */
  7. class Widget extends SQLiteEntity{
  8. public $id,$minified,$column,$cell,$model,$data,$dashboard;
  9. protected $TABLE_NAME = 'plugin_dashboard';
  10. protected $CLASS_NAME = 'Widget';
  11. protected $object_fields =
  12. array(
  13. 'id'=>'key',
  14. 'model'=>'longstring',
  15. 'data'=>'longstring',
  16. 'cell'=>'int',
  17. 'column'=>'int',
  18. 'minified' => 'int',
  19. 'dashboard' => 'int'
  20. );
  21. function __construct(){
  22. parent::__construct();
  23. $this->dashboard = 0;
  24. }
  25. public function data($data=null){
  26. if(empty($data)){
  27. $array = json_decode($this->data,true);
  28. return is_array($array)?$array:array();
  29. }else{
  30. $this->data = json_encode($data);
  31. }
  32. }
  33. }
  34. ?>