Event.class.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?php
  2. class Event extends SQLiteEntity{
  3. protected $id,$title,$guid,$content,$description,$pudate,$link,$feed,$category,$creator,$unread;
  4. protected $TABLE_NAME = 'event';
  5. protected $CLASS_NAME = 'Event';
  6. protected $object_fields =
  7. array(
  8. 'id'=>'key',
  9. 'guid'=>'longstring',
  10. 'title'=>'string',
  11. 'creator'=>'string',
  12. 'content'=>'longstring',
  13. 'description'=>'longstring',
  14. 'unread'=>'integer',
  15. 'feed'=>'integer',
  16. 'unread'=>'integer',
  17. 'pubdate'=>'string'
  18. );
  19. function __construct($guid=null,$title=null,$description=null,$content=null,$pubdate=null,$link=null,$category=null,$creator=null){
  20. $this->guid = $guid;
  21. $this->title = $title;
  22. $this->creator = $creator;
  23. $this->content = $content;
  24. $this->description = $description;
  25. $this->pubdate = $pubdate;
  26. $this->link = $link;
  27. $this->category = $category;
  28. parent::__construct();
  29. }
  30. function getCreator(){
  31. return $this->creator;
  32. }
  33. function setCreator($creator){
  34. $this->creator = $creator;
  35. }
  36. function getCategory(){
  37. return $this->category;
  38. }
  39. function setCategory($category){
  40. $this->category = $category;
  41. }
  42. function getDescription(){
  43. return utf8_encode($this->description);
  44. }
  45. function setDescription($description){
  46. $this->description = $description;
  47. }
  48. function getPubdate(){
  49. return $this->pubdate;
  50. }
  51. function setPubdate($pubdate){
  52. $this->pubdate = date('d/m/Y H:i:s',strtotime($pubdate));
  53. }
  54. function getLink(){
  55. return $this->link;
  56. }
  57. function setLink($link){
  58. $this->link = $link;
  59. }
  60. function getId(){
  61. return $this->id;
  62. }
  63. function getTitle(){
  64. return $this->title;
  65. }
  66. function setTitle($title){
  67. $this->title = $title;
  68. }
  69. function getContent(){
  70. return $this->content;
  71. }
  72. function setContent($content){
  73. $this->content = $content;
  74. }
  75. function getGuid(){
  76. return $this->guid;
  77. }
  78. function setGuid($guid){
  79. $this->guid = $guid;
  80. }
  81. function getUnread(){
  82. return $this->unread;
  83. }
  84. function setUnread($unread){
  85. $this->unread = $unread;
  86. }
  87. function setFeed($feed){
  88. $this->feed = $feed;
  89. }
  90. function getFeed(){
  91. return $this->feed;
  92. }
  93. }
  94. ?>