Advertisement
Truger

Untitled

Feb 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Models;
  4.  
  5.  
  6. class Comment extends \Nikstas\ORM\Model\Model
  7. {
  8. /**
  9. * @var string
  10. */
  11. public static $tableName = "comments";
  12.  
  13. /**
  14. * @var string
  15. */
  16. private $userId, $postId, $content, $createdAt, $updatedAd;
  17.  
  18. /**
  19. * @return int
  20. */
  21. public function getId(): int
  22. {
  23. return $this->id;
  24. }
  25.  
  26. /**
  27. * @param int $id
  28. */
  29. public function setId(int $id): void
  30. {
  31. $this->id = $id;
  32. }
  33.  
  34. /**
  35. * @return mixed
  36. */
  37.  
  38. /**
  39. * @return string
  40. */
  41. public function getUserId(): string
  42. {
  43. return $this->userId;
  44. }
  45.  
  46. /**
  47. * @param string $userId
  48. */
  49. public function setUserId(string $userId)
  50. {
  51. $this->userId = $userId;
  52. }
  53.  
  54. /**
  55. * @return string
  56. */
  57.  
  58. public function getPostId(): string
  59. {
  60. return $this->postId;
  61. }
  62.  
  63. /**
  64. * @param string $postId
  65. */
  66. public function setPostId(string $postId)
  67. {
  68. $this->postId = $postId;
  69. }
  70.  
  71. /**
  72. * @return string
  73. */
  74. public function getContent(): string
  75. {
  76. return $this->content;
  77. }
  78.  
  79. /**
  80. * @param string $content
  81. */
  82. public function setContent(string $content)
  83. {
  84. $this->content = $content;
  85. }
  86.  
  87. /**
  88. * @return string
  89. */
  90. public function getCreatedAt(): string
  91. {
  92. return $this->createdAt;
  93. }
  94.  
  95. /**
  96. * @param string $createdAt
  97. */
  98. public function setCreatedAt(string $createdAt)
  99. {
  100. $this->createdAt = $createdAt;
  101. }
  102.  
  103. /**
  104. * @return string
  105. */
  106. public function getUpdatedAd(): string
  107. {
  108. return $this->updatedAd;
  109. }
  110.  
  111. /**
  112. * @param string $updatedAd
  113. */
  114. public function setUpdatedAd(string $updatedAd)
  115. {
  116. $this->updatedAd = $updatedAd;
  117. }
  118.  
  119. /**
  120. * @return array
  121. */
  122. public function getValues(): array
  123. {
  124. return [
  125. 'id' => $this->id,
  126. 'user_id' => $this->userId,
  127. 'post_id' => $this->postId,
  128. 'content' => $this->content,
  129. 'created_at' => $this->createdAt,
  130. 'updated_at' => $this->updatedAd
  131. ];
  132. }
  133.  
  134. /**
  135. * @return array
  136. */
  137. public function getFields(): array
  138. {
  139. return ['id', 'user_id', 'post_id', 'content', 'created_at', 'updated_at'];
  140. }
  141. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement