Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
QuestionRepository | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
getPredefinedQuestion | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace Olz\Repository\Faq; |
4 | |
5 | use Olz\Entity\Faq\Question; |
6 | use Olz\Repository\Common\OlzRepository; |
7 | |
8 | /** |
9 | * @extends OlzRepository<Question> |
10 | */ |
11 | class QuestionRepository extends OlzRepository { |
12 | protected string $question_class = Question::class; |
13 | |
14 | public function getPredefinedQuestion(PredefinedQuestion $predefined_question): ?Question { |
15 | $question = $this->findOneBy(['ident' => $predefined_question->value]); |
16 | if (!$question) { |
17 | $this->log()->warning("Predefined question does not exist: {$predefined_question->value}"); |
18 | } |
19 | return $question; |
20 | } |
21 | } |