Total Complexity | 8 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class PageRepositorySql implements PageRepository |
||
13 | { |
||
14 | public function get(string $pageId): ?Page |
||
21 | } |
||
22 | |||
23 | public function getByIds(array $pagesIds): array |
||
24 | { |
||
25 | $pageModels = PageModel::query() |
||
26 | ->whereIn('page_id', $pagesIds) |
||
27 | ->get(); |
||
28 | foreach ($pageModels as $pageModel) { |
||
29 | $pages[] = new Page( |
||
30 | $pageModel->page_id, |
||
31 | $pageModel->dry, |
||
32 | $pageModel->title, |
||
33 | $pageModel->type, |
||
34 | $pageModel->icon |
||
35 | ); |
||
36 | } |
||
37 | return $pages ?? []; |
||
38 | } |
||
39 | |||
40 | public function save(Page $page) |
||
49 | } |
||
50 | |||
51 | public function search(string $type, string $search):array |
||
61 | } |
||
62 | |||
64 |