Total Complexity | 4 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 88.24% |
Changes | 0 |
1 | <?php |
||
14 | trait net_nemein_wiki_handler |
||
15 | { |
||
16 | 3 | public function load_page(string $wikiword) : net_nemein_wiki_wikipage |
|
17 | { |
||
18 | 3 | $qb = net_nemein_wiki_wikipage::new_query_builder(); |
|
19 | 3 | $qb->add_constraint('topic', '=', $this->_topic->id); |
|
|
|||
20 | 3 | $qb->add_constraint('name', '=', $wikiword); |
|
21 | |||
22 | 3 | if ($result = $qb->execute()) { |
|
23 | 3 | return $result[0]; |
|
24 | } |
||
25 | throw new midcom_error_notfound('The page "' . $wikiword . '" could not be found.'); |
||
26 | } |
||
27 | |||
28 | 2 | public function initialize_index_article(midcom_db_topic $topic) : net_nemein_wiki_wikipage |
|
40 | } |
||
41 | } |
||
42 |