Total Complexity | 4 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class CategoryLayoutUpdateManager extends LayoutUpdateManager |
||
13 | { |
||
14 | /** |
||
15 | * @var array Keys are category IDs, values - file names. |
||
16 | */ |
||
17 | private $fakeFiles = []; |
||
18 | |||
19 | /** |
||
20 | * Supply fake files for a Category. |
||
21 | * |
||
22 | * @param int $forCategoryId |
||
23 | * @param string[]|null $files Pass null to reset. |
||
24 | */ |
||
25 | public function setFakeFiles(int $forCategoryId, ?array $files): void |
||
31 | } |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * Fetches fake/mock files added through $this->setCategoryFakeFiles() |
||
36 | * for current Category and Global (0) |
||
37 | * |
||
38 | * If none found, fall back to original method |
||
39 | * |
||
40 | * @param CategoryInterface $category |
||
41 | * @return array |
||
42 | */ |
||
43 | public function fetchAvailableFiles(CategoryInterface $category): array |
||
53 |