1 | <?php |
||
8 | class CommentTable |
||
9 | { |
||
10 | /** |
||
11 | * @var TableGateway |
||
12 | */ |
||
13 | protected $tableGateway; |
||
14 | |||
15 | public function __construct(TableGateway $tableGateway) |
||
19 | |||
20 | /** |
||
21 | * Returns all the comments. |
||
22 | * |
||
23 | * @return ResultSet |
||
24 | */ |
||
25 | public function fetchAll() |
||
29 | |||
30 | /** |
||
31 | * Returns all the comments of a thread. |
||
32 | * |
||
33 | * @param string $thread |
||
34 | * |
||
35 | * @return ResultSet |
||
36 | */ |
||
37 | public function fetchAllForThread($thread) |
||
57 | |||
58 | /** |
||
59 | * Returns all the comments pending approval for a thread. |
||
60 | * |
||
61 | * @param string $thread |
||
62 | * |
||
63 | * @return ResultSet |
||
64 | */ |
||
65 | public function fetchAllPendingForThread($thread) |
||
85 | |||
86 | /** |
||
87 | * Allow custom comments selection. |
||
88 | * |
||
89 | * @param Select $select |
||
90 | * |
||
91 | * @return ResultSet |
||
92 | */ |
||
93 | public function fetchAllUsingSelect(Select $select) |
||
97 | |||
98 | /** |
||
99 | * Returns a comment by id. |
||
100 | * |
||
101 | * @param int $id |
||
102 | * |
||
103 | * @return Comment |
||
104 | */ |
||
105 | public function getComment($id) |
||
113 | |||
114 | /** |
||
115 | * Saves a comment into the database. |
||
116 | * |
||
117 | * @param Comment $comment |
||
118 | * |
||
119 | * @return int The id of the inserted/updated comment |
||
120 | */ |
||
121 | public function saveComment(Comment $comment) |
||
145 | |||
146 | /** |
||
147 | * Removes a comment from the database. |
||
148 | * |
||
149 | * @param int $id |
||
150 | */ |
||
151 | public function deleteComment($id) |
||
155 | |||
156 | |||
157 | /** |
||
158 | * Deletes all comments maked as spam from the database. |
||
159 | * |
||
160 | * @return int - number of rows affected. |
||
161 | */ |
||
162 | public function deleteSpam() |
||
166 | } |
||
167 |