Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Interface for comments repository. |
| 5 | * |
| 6 | * This Source Code Form is subject to the terms of the Mozilla Public License, |
| 7 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
| 8 | * obtain one at https://mozilla.org/MPL/2.0/. |
| 9 | * |
| 10 | * @package phpMyFAQ |
| 11 | * @author phpMyFAQ Team |
| 12 | * @license https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
| 13 | */ |
| 14 | |
| 15 | declare(strict_types=1); |
| 16 | |
| 17 | namespace phpMyFAQ\Comment; |
| 18 | |
| 19 | use phpMyFAQ\Entity\Comment; |
| 20 | |
| 21 | interface CommentsRepositoryInterface |
| 22 | { |
| 23 | /** @return array<int, \stdClass> */ |
| 24 | public function fetchByReferenceIdAndType(int $referenceId, string $type): array; |
| 25 | |
| 26 | public function insert(Comment $comment): bool; |
| 27 | |
| 28 | public function deleteByTypeAndId(string $type, int $commentId): bool; |
| 29 | |
| 30 | /** @return array<int, \stdClass> */ |
| 31 | public function countByTypeGroupedByRecordId(string $type = \phpMyFAQ\Entity\CommentType::FAQ): array; |
| 32 | |
| 33 | /** @return array<int, \stdClass> */ |
| 34 | public function countByCategoryForFaq(): array; |
| 35 | |
| 36 | /** @return array<int, \stdClass> */ |
| 37 | public function fetchAllWithCategories(string $type = \phpMyFAQ\Entity\CommentType::FAQ): array; |
| 38 | |
| 39 | public function isCommentAllowed(int $recordId, string $recordLang, string $commentType = 'faq'): bool; |
| 40 | } |