PageRenderTime 27ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/web/editor/common/entities.php

https://bitbucket.org/keento/diagramo-janis
PHP | 121 lines | 102 code | 19 blank | 0 comment | 0 complexity | e893b1f50632115d96c33eb8a7af3783 MD5 | raw file
Possible License(s): GPL-2.0, IPL-1.0
  1. <?php
  2. $currentFolder = dirname(__FILE__);
  3. class Diagram {
  4. public $id;
  5. public $hash;
  6. public $title;
  7. public $description;
  8. public $public;
  9. public $createdDate;
  10. public $lastUpdate;
  11. public $size;
  12. function loadFromSQL($row) {
  13. $this->id = is_null($row['id']) ? null : $row['id'];
  14. $this->hash = is_null($row['hash']) ? null : $row['hash'];
  15. $this->title = is_null($row['title']) ? null : $row['title'];
  16. $this->description = is_null($row['description']) ? null : $row['description'];
  17. $this->public = is_null($row['public']) ? null : $row['public'];
  18. $this->createdDate = is_null($row['createdDate']) ? null : $row['createdDate'];
  19. $this->lastUpdate = is_null($row['lastUpdate']) ? null : $row['lastUpdate'];
  20. $this->size = is_null($row['size']) ? null : $row['size'];
  21. }
  22. }
  23. class Diagramdata {
  24. const TYPE_DIA = 'dia';
  25. const TYPE_SVG = 'svg';
  26. const TYPE_JPG = 'jpg';
  27. const TYPE_PNG = 'png';
  28. public $diagramId;
  29. public $type;
  30. public $fileName;
  31. public $fileSize;
  32. public $lastUpdate;
  33. function loadFromSQL($row) {
  34. $this->diagramId = is_null($row['diagramId']) ? null : $row['diagramId'];
  35. $this->type = is_null($row['type']) ? null : $row['type'];
  36. $this->fileName = is_null($row['fileName']) ? null : $row['fileName'];
  37. $this->fileSize = is_null($row['fileSize']) ? null : $row['fileSize'];
  38. $this->lastUpdate = is_null($row['lastUpdate']) ? null : $row['lastUpdate'];
  39. }
  40. }
  41. class Invitation {
  42. public $id;
  43. public $diagramId;
  44. public $email;
  45. public $token;
  46. public $createdDate;
  47. function loadFromSQL($row) {
  48. $this->id = is_null($row['id']) ? null : $row['id'];
  49. $this->diagramId = is_null($row['diagramId']) ? null : $row['diagramId'];
  50. $this->email = is_null($row['email']) ? null : $row['email'];
  51. $this->token = is_null($row['token']) ? null : $row['token'];
  52. $this->createdDate = is_null($row['createdDate']) ? null : $row['createdDate'];
  53. }
  54. }
  55. class Setting {
  56. public $name;
  57. public $value;
  58. function loadFromSQL($row) {
  59. $this->name = is_null($row['name']) ? null : $row['name'];
  60. $this->value = is_null($row['value']) ? null : $row['value'];
  61. }
  62. }
  63. class User {
  64. public $id;
  65. public $email;
  66. public $password;
  67. public $name;
  68. public $createdDate;
  69. public $lastLoginDate;
  70. public $lastLoginIP;
  71. public $lastBrowserType;
  72. function loadFromSQL($row) {
  73. $this->id = is_null($row['id']) ? null : $row['id'];
  74. $this->email = is_null($row['email']) ? null : $row['email'];
  75. $this->password = is_null($row['password']) ? null : $row['password'];
  76. $this->name = is_null($row['name']) ? null : $row['name'];
  77. $this->createdDate = is_null($row['createdDate']) ? null : $row['createdDate'];
  78. $this->lastLoginDate = is_null($row['lastLoginDate']) ? null : $row['lastLoginDate'];
  79. $this->lastLoginIP = is_null($row['lastLoginIP']) ? null : $row['lastLoginIP'];
  80. $this->lastBrowserType = is_null($row['lastBrowserType']) ? null : $row['lastBrowserType'];
  81. }
  82. }
  83. class Userdiagram {
  84. const STATUS_ACCEPTED = 'accepted';
  85. const STATUS_PENDING = 'pending';
  86. const STATUS_KICKEDOF = 'kickedof';
  87. const LEVEL_EDITOR = 'editor';
  88. const LEVEL_AUTHOR = 'author';
  89. public $userId;
  90. public $diagramId;
  91. public $invitedDate;
  92. public $status;
  93. public $level;
  94. function loadFromSQL($row) {
  95. $this->userId = is_null($row['userId']) ? null : $row['userId'];
  96. $this->diagramId = is_null($row['diagramId']) ? null : $row['diagramId'];
  97. $this->invitedDate = is_null($row['invitedDate']) ? null : $row['invitedDate'];
  98. $this->status = is_null($row['status']) ? null : $row['status'];
  99. $this->level = is_null($row['level']) ? null : $row['level'];
  100. }
  101. }
  102. ?>